AI-generated Key Takeaways
-
The
ScriptApp
service allows you to control and interact with the deployment of your script as a web application. -
You can retrieve the web app's URL using
getUrl()
, check its accessibility status withisEnabled()
, and previously, disable it using the now deprecateddisable()
method. -
The
disable()
method has been deprecated and should no longer be used in new scripts, replaced by the "Publish > Deploy as web app" dialog for disabling. -
When deploying your script as a web app, you can use provided methods to obtain its URL and determine if it's enabled for access.
Access and manipulate script publishing.
Methods
Method | Return type | Brief description |
---|---|---|
get | String | Returns the URL of the web app, if it has been deployed; otherwise returns null . |
is | Boolean | Returns true if the script is accessible as a web app. |
Detailed documentation
getUrl()
Returns the URL of the web app, if it has been deployed; otherwise returns null
. If you
are running the development mode web app, this returns the development mode url.
// Mail the URL of the published web app. MailApp.sendMail( 'myself@example.com', 'My Snazzy App', `My new app is now available at ${ScriptApp.getService().getUrl()}`, );
Return
String
— the URL of the web app
isEnabled()
Returns true
if the script is accessible as a web app.
Return
Boolean
— true
if the script is published as a web app; false
if not