সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।
স্ক্রিপ্টগুলি ব্যবহারকারী-ইন্টারফেস উপাদানগুলি যোগ করে নির্দিষ্ট Google পণ্যগুলিকে প্রসারিত করতে পারে যা ক্লিক করা হলে, একটি Apps স্ক্রিপ্ট ফাংশন কার্যকর করে৷ সবচেয়ে সাধারণ উদাহরণ হল Google ডক্স, শীট, স্লাইড বা ফর্মগুলিতে একটি কাস্টম মেনু আইটেম থেকে একটি স্ক্রিপ্ট চালানো, তবে স্ক্রিপ্ট ফাংশনগুলি Google পত্রকের ছবি এবং অঙ্কনগুলিতে ক্লিক করার মাধ্যমেও ট্রিগার করা যেতে পারে।
Google ডক্স, পত্রক, স্লাইড বা ফর্মগুলিতে কাস্টম মেনু
অ্যাপস স্ক্রিপ্ট Google ডক্স, শীট, স্লাইড বা ফর্মগুলিতে নতুন মেনু যোগ করতে পারে, প্রতিটি মেনু আইটেম একটি স্ক্রিপ্টের একটি ফাংশনের সাথে আবদ্ধ। (Google ফর্মগুলিতে, কাস্টম মেনুগুলি কেবলমাত্র একজন সম্পাদকের কাছে দৃশ্যমান হয় যিনি ফর্মটি সংশোধন করার জন্য খোলেন, এমন কোনও ব্যবহারকারীর কাছে নয় যিনি প্রতিক্রিয়া জানাতে ফর্মটি খোলেন৷)
একটি স্ক্রিপ্ট শুধুমাত্র একটি মেনু তৈরি করতে পারে যদি এটি নথি, স্প্রেডশীট বা ফর্মের সাথে আবদ্ধ থাকে। ব্যবহারকারী একটি ফাইল খোলে মেনু প্রদর্শন করতে, একটি onOpen() ফাংশনের মধ্যে মেনু কোড লিখুন।
নীচের উদাহরণটি দেখায় কিভাবে একটি আইটেমের সাথে একটি মেনু যোগ করতে হয়, তারপরে একটি ভিজ্যুয়াল বিভাজক , তারপর একটি সাব-মেনু যাতে অন্য একটি আইটেম থাকে৷ (উল্লেখ্য যে Google পত্রকগুলিতে, আপনি যদি নতুন সংস্করণ ব্যবহার না করেন, তাহলে আপনাকে অবশ্যই এর পরিবর্তে addMenu() সিনট্যাক্স ব্যবহার করতে হবে এবং সাব-মেনুগুলি সম্ভব নয়।) যখন ব্যবহারকারী যেকোন একটি মেনু আইটেম নির্বাচন করেন, একটি সংশ্লিষ্ট ফাংশন একটি সতর্কতা ডায়ালগ খোলে। আপনি যে ধরনের ডায়ালগ খুলতে পারেন সে সম্পর্কে আরও তথ্যের জন্য, ডায়ালগ এবং সাইডবারগুলির নির্দেশিকা দেখুন।
functiononOpen(){varui=SpreadsheetApp.getUi();//OrDocumentApp,SlidesApporFormApp.ui.createMenu('Custom Menu').addItem('First item','menuItem1').addSeparator().addSubMenu(ui.createMenu('Sub-menu').addItem('Second item','menuItem2')).addToUi();}functionmenuItem1(){SpreadsheetApp.getUi()//OrDocumentApp,SlidesApporFormApp..alert('You clicked the first menu item!');}functionmenuItem2(){SpreadsheetApp.getUi()//OrDocumentApp,SlidesApporFormApp..alert('You clicked the second menu item!');}
একটি নথি, স্প্রেডশীট, উপস্থাপনা, বা ফর্ম একটি প্রদত্ত নামের সাথে শুধুমাত্র একটি মেনু থাকতে পারে। যদি একই স্ক্রিপ্ট বা অন্য স্ক্রিপ্ট একই নামের একটি মেনু যোগ করে, নতুন মেনুটি পুরানোটিকে প্রতিস্থাপন করে। ফাইল খোলা থাকা অবস্থায় মেনুগুলি সরানো যাবে না, যদিও আপনি একটি নির্দিষ্ট বৈশিষ্ট্য সেট করা থাকলে ভবিষ্যতে মেনুটি এড়িয়ে যেতে আপনার onOpen() ফাংশন লিখতে পারেন।
Google পত্রকগুলিতে ক্লিকযোগ্য ছবি এবং অঙ্কন
আপনি Google পত্রকগুলিতে একটি চিত্র বা অঙ্কনে একটি Apps স্ক্রিপ্ট ফাংশন বরাদ্দ করতে পারেন, যতক্ষণ না স্প্রেডশীটে স্ক্রিপ্টটি আবদ্ধ থাকে৷ নীচের উদাহরণটি দেখায় কিভাবে এটি সেট আপ করতে হয়।
Google পত্রকগুলিতে, স্প্রেডশীটের সাথে আবদ্ধ একটি স্ক্রিপ্ট তৈরি করতে মেনু আইটেমটি এক্সটেনশন>অ্যাপস স্ক্রিপ্ট নির্বাচন করুন৷
স্ক্রিপ্ট এডিটর থেকে যেকোনো কোড মুছুন এবং নিচের কোডে পেস্ট করুন।
function showMessageBox() { Browser.msgBox('You clicked it!'); }
শীটে ফিরে যান এবং সন্নিবেশ > চিত্র বা সন্নিবেশ > অঙ্কন নির্বাচন করে একটি ছবি বা অঙ্কন সন্নিবেশ করুন।
ছবি বা অঙ্কন সন্নিবেশ করার পরে, এটি ক্লিক করুন. উপরের ডানদিকের কোণায় একটি ছোট ড্রপ-ডাউন মেনু নির্বাচক উপস্থিত হয়। এটিতে ক্লিক করুন এবং স্ক্রিপ্ট বরাদ্দ করুন নির্বাচন করুন।
প্রদর্শিত ডায়ালগ বক্সে, অ্যাপস স্ক্রিপ্ট ফাংশনের নাম টাইপ করুন যা আপনি চালাতে চান, বন্ধনী ছাড়া — এই ক্ষেত্রে, showMessageBox । ওকে ক্লিক করুন।
ছবি বা অঙ্কন আবার ক্লিক করুন. ফাংশন এখন সঞ্চালিত হয়.
[[["সহজে বোঝা যায়","easyToUnderstand","thumb-up"],["আমার সমস্যার সমাধান হয়েছে","solvedMyProblem","thumb-up"],["অন্যান্য","otherUp","thumb-up"]],[["এতে আমার প্রয়োজনীয় তথ্য নেই","missingTheInformationINeed","thumb-down"],["খুব জটিল / অনেক ধাপ","tooComplicatedTooManySteps","thumb-down"],["পুরনো","outOfDate","thumb-down"],["অনুবাদ সংক্রান্ত সমস্যা","translationIssue","thumb-down"],["নমুনা / কোড সংক্রান্ত সমস্যা","samplesCodeIssue","thumb-down"],["অন্যান্য","otherDown","thumb-down"]],["2025-08-04 UTC-তে শেষবার আপডেট করা হয়েছে।"],[[["\u003cp\u003eApps Script allows you to extend Google products like Docs, Sheets, Slides, and Forms by adding custom menus and clickable elements that trigger script functions.\u003c/p\u003e\n"],["\u003cp\u003eCustom menus can be created within these Google products, with each menu item linked to a specific function in your script, enhancing user interaction and functionality.\u003c/p\u003e\n"],["\u003cp\u003eIn Google Sheets, you can assign Apps Script functions to images and drawings, making them interactive elements that execute code when clicked in a web browser.\u003c/p\u003e\n"]]],[],null,["Scripts can extend certain Google products by adding user-interface elements\nthat, when clicked, execute an Apps Script function. The most common example is\nrunning a script from a custom menu item in Google Docs, Sheets, Slides,\nor Forms, but script functions can also be triggered by clicking on images and\ndrawings in Google Sheets.\n\nCustom menus in Google Docs, Sheets, Slides, or Forms\n\nApps Script can add new menus in Google Docs, Sheets, Slides,\nor Forms, with\neach menu item tied to a function in a script. (In Google Forms, custom menus\nare visible only to an editor who opens the form to modify it, not to a user who\nopens the form to respond.)\n\nA script can only create a menu if it is\n[bound](/apps-script/scripts_containers) to the document, spreadsheet, or form.\nTo display the menu when the user opens a file, write the menu code within an\n[`onOpen()`](/apps-script/understanding_triggers) function.\n\nThe example below shows how to add a [menu](/apps-script/reference/base/menu)\nwith one item, followed by a\n[visual separator](/apps-script/reference/base/menu#addSeparator()), then a\n[sub-menu](/apps-script/reference/base/menu#addSubMenu(Menu)) that contains\nanother item. (Note that in Google Sheets, unless you're using the\n[new version](https://support.google.com/drive/answer/3541068), you must use the\n[`addMenu()`](/apps-script/reference/spreadsheet/spreadsheet#addMenu(String,Object))\nsyntax instead, and sub-menus are not possible.) When the user selects either\nmenu item, a corresponding function opens an\n[alert](/apps-script/reference/base/ui#alert(String)) dialog. For more\ninformation on the types of dialogs you can open, see the\n[guide to dialogs and sidebars](/apps-script/guides/dialogs). \n\n function onOpen() {\n var ui = SpreadsheetApp.getUi();\n // Or DocumentApp, SlidesApp or FormApp.\n ui.createMenu('Custom Menu')\n .addItem('First item', 'menuItem1')\n .addSeparator()\n .addSubMenu(ui.createMenu('Sub-menu')\n .addItem('Second item', 'menuItem2'))\n .addToUi();\n }\n\n function menuItem1() {\n SpreadsheetApp.getUi() // Or DocumentApp, SlidesApp or FormApp.\n .alert('You clicked the first menu item!');\n }\n\n function menuItem2() {\n SpreadsheetApp.getUi() // Or DocumentApp, SlidesApp or FormApp.\n .alert('You clicked the second menu item!');\n }\n\nA document, spreadsheet, presentation, or form can only contain one menu with\na given name. If the same script or another script adds a menu with the same\nname, the new menu replaces the old. Menus cannot be removed while the file\nis open, although you can write your `onOpen()` function to skip the menu in\nthe future if a certain [property](/apps-script/guides/properties) is set.\n| **Note:** [Editor add-ons](/workspace/add-ons/concepts/types#editor_add-ons) can have menu items as well, but use [special rules](/workspace/add-ons/concepts/menus) they are defined.\n\nClickable images and drawings in Google Sheets\n\nYou can also assign an Apps Script function to an image or drawing in Google Sheets,\nso long as the script is [bound](/apps-script/scripts_containers) to the\nspreadsheet. The example below shows how to set this up.\n\n1. In Google Sheets, select the menu item **Extensions** \\\u003e **Apps Script** to create a script that is bound to the spreadsheet.\n2. Delete any code in the script editor and paste in the code below.\n\n function showMessageBox() {\n Browser.msgBox('You clicked it!');\n }\n\n3. Return to Sheets and insert an image or drawing by selecting\n **Insert \\\u003e Image** or **Insert \\\u003e Drawing**.\n\n4. After inserting the image or drawing, click it. A small drop-down menu\n selector appears in the top right-hand corner. Click it and choose\n **Assign script**.\n\n5. In the dialog box that appears, type the name of the Apps Script function\n that you want to run, without parentheses --- in this case, `showMessageBox`.\n Click **OK**.\n\n6. Click the image or drawing again. The function now executes.\n\n| **Note:** The script execution is only triggered by clicking the image or drawing in a web browser. The script doesn't execute if the image or drawing is clicked on mobile."]]