A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.google.com/apps-script/scripts_containers below:

Container-bound Scripts | Apps Script

Skip to main content Container-bound Scripts

Stay organized with collections Save and categorize content based on your preferences.

A script is bound to a Google Sheets, Docs, Slides, or Forms file if it was created from that document rather than as a standalone script. The file that a bound script is attached to is called a "container." Bound scripts generally behave like standalone scripts except that they do not appear in Google Drive, they cannot be detached from the file they are bound to, and they gain a few special privileges over the parent file.

Note that scripts can also be bound to Google Sites, but these scripts are almost always deployed as web apps. Scripts bound to Google Sheets, Docs, Slides, or Forms can also become web apps, although this is uncommon.

Note: Bound scripts are effectively unpublished add-ons that function only for the file they are bound to. Create a bound script Google Docs, Sheets, or Slides

To create a bound script in Google Docs, Sheets, or Slides, open a document in Docs, a spreadsheet in Sheets, or a presentation in Slides and click Extensions > Apps Script. To reopen the script in the future, do the same thing or open the script from the Apps Script dashboard.

Google Forms

To create a bound script in Google Forms, open a form and click More more_vert > Script editor. To reopen the script in the future, do the same thing or open the script from the Apps Script dashboard.

Note: The clasp tool can't create bound scripts, but it can clone and edit them. Special methods

Bound scripts can call a few methods that standalone scripts cannot:

For more information, see the guide to extending Google Sheets or the guide to extending Google Docs.

Note: These methods are only available to bound scripts run from the script editor, menu items, dialogs, sidebars, or triggers. When a bound script is run as a web app or via the Apps Script API, these methods are not available.

Bound scripts can customize Google Sheets, Docs, and Forms by adding custom menus and dialog boxes or sidebars. Keep in mind, however, that a script can only interact with the user interface for the current instance of an open file. That is, a script bound to one document cannot affect the user interface of another document.

Add-ons can also add custom menus, dialogs and sidebars. It is recommended to develop add-ons using standalone scripts. Triggers

Bound scripts can use simple triggers like the special onOpen() function, which runs automatically whenever a file is opened by a user who has edit access. Like all types of scripts, they can also use installable triggers.

Custom functions

A custom function is a function in a script bound to Google Sheets that you call directly from a cell using the syntax =myFunctionName(). Custom functions are thus similar to the hundreds of built-in functions in Sheets like AVERAGE or SUM except that you define the custom function's behavior.

Access to bound scripts

Only users who have permission to edit a container can run its bound script. Collaborators who have only view access can't open the script editor, although if they make a copy of the container file, they become the owner of the copy and can see and run a copy of the script.

To learn how to share a script's container file, refer to Share files from Google Drive.

All container-bound scripts use the same owner, viewer, and editor access list defined for the container file. The container owner takes ownership of a new script project regardless of who created it.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-04 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-04 UTC."],[[["Bound scripts are Google Apps Scripts attached to Google Docs, Sheets, Slides, or Forms, offering special privileges to interact with their parent file."],["Unlike standalone scripts, bound scripts reside within their container file and cannot be detached, functioning like unpublished add-ons specific to that file."],["They allow the use of special methods to programmatically access and manipulate the parent file's content and user interface."],["Bound scripts can be shared by sharing the container file, enabling collaborators with edit access to run the script."],["These scripts can also be published as add-ons, making them accessible to a wider audience through the add-on store."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4