如果 Web 应用已经部署,则返回它的网址;否则返回 null。如果您
正在运行开发模式 Web 应用,则会返回开发模式网址。
// 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());
返回
String - Web 应用的网址
isEnabled()
如果脚本可作为 Web 应用访问,则返回 true。
返回
Boolean - 如果脚本作为 Web 应用发布,则为 true;如果不是,则设为 false
已弃用的方法
disable()
已弃用。此函数已弃用,不应在新脚本中使用。
禁止将脚本作为 Web 应用进行访问。此方法相当于打开
“发布 >部署为 Web 应用”对话框中,点击“停用 Web 应用”。
[[["易于理解","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"]],["最后更新时间 (UTC):2024-08-29。"],[[["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 with `isEnabled()`, and previously, disable it using the now deprecated `disable()` method."],["The `disable()` method has been deprecated and should no longer be used in new scripts, replaced by the \"Publish \u003e 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."]]],[]]