티스토리 수익 글 보기
Class Service
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
-
The
Serviceclass allows access and manipulation of script publishing, specifically for web apps. -
The
getUrl()method returns the URL of a deployed web app ornullif not deployed. -
The
isEnabled()method indicates whether a script is accessible as a web app. -
The
disable()method, though deprecated, was used to disable a script from being accessed as a web app.
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.
Deprecated methods
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 2026-04-13 UTC.