Class Service
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
서비스
스크립트 게시에 액세스하고 조작합니다.
메서드
메서드 | 반환 유형 | 간략한 설명 |
getUrl() | String | 웹 앱이 배포된 경우 웹 앱의 URL을 반환하고, 그렇지 않으면 null 를 반환합니다. |
isEnabled() | Boolean | 스크립트에 웹 앱으로 액세스할 수 있는 경우 true 을 반환합니다. |
지원 중단된 메서드
메서드 | 반환 유형 | 간략한 설명 |
disable()
| void | 스크립트에 웹 앱으로 액세스할 수 없도록 합니다. |
자세한 문서
getUrl()
웹 앱이 배포된 경우 웹 앱의 URL을 반환하고, 그렇지 않으면 null
를 반환합니다. 개발 모드 웹 앱을 실행하는 경우 개발 모드 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()}`,
);
리턴
String
: 웹 앱의 URL
isEnabled()
스크립트에 웹 앱으로 액세스할 수 있는 경우 true
을 반환합니다.
리턴
Boolean
: 스크립트가 웹 앱으로 게시된 경우 true
이고 그렇지 않은 경우 false
입니다.
지원 중단된 메서드
disable()
지원 중단되었습니다. 이 함수는 지원 중단되었으며 새 스크립트에서 사용해서는 안 됩니다.
스크립트에 웹 앱으로 액세스할 수 없도록 합니다. 이 메서드는 '게시 > 웹 앱으로 배포' 대화상자를 열고 '웹 앱 사용 중지'를 클릭하는 것과 같습니다.
ScriptApp.getService().disable();
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-26(UTC)
[null,null,["최종 업데이트: 2025-07-26(UTC)"],[[["\u003cp\u003eThe \u003ccode\u003eScriptApp\u003c/code\u003e service allows you to control and interact with the deployment of your script as a web application.\u003c/p\u003e\n"],["\u003cp\u003eYou can retrieve the web app's URL using \u003ccode\u003egetUrl()\u003c/code\u003e, check its accessibility status with \u003ccode\u003eisEnabled()\u003c/code\u003e, and previously, disable it using the now deprecated \u003ccode\u003edisable()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003edisable()\u003c/code\u003e method has been deprecated and should no longer be used in new scripts, replaced by the "Publish > Deploy as web app" dialog for disabling.\u003c/p\u003e\n"],["\u003cp\u003eWhen deploying your script as a web app, you can use provided methods to obtain its URL and determine if it's enabled for access.\u003c/p\u003e\n"]]],[],null,["# Class Service\n\nService\n\nAccess and manipulate script publishing. \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------|-------------|------------------------------------------------------------------------------------|\n| [getUrl()](#getUrl()) | `String` | Returns the URL of the web app, if it has been deployed; otherwise returns `null`. |\n| [isEnabled()](#isEnabled()) | `Boolean` | Returns `true` if the script is accessible as a web app. |\n\n### Deprecated methods\n\n| Method | Return type | Brief description |\n|-------------------------|-------------|-------------------------------------------------------|\n| [disable()](#disable()) | `void` | Disables the script from being accessed as a web app. |\n\nDetailed documentation\n----------------------\n\n### `get``Url()`\n\nReturns the URL of the web app, if it has been deployed; otherwise returns `null`. If you\nare running the development mode web app, this returns the development mode url.\n\n```javascript\n// Mail the URL of the published web app.\nMailApp.sendMail(\n 'myself@example.com',\n 'My Snazzy App',\n `My new app is now available at ${ScriptApp.getService().getUrl()}`,\n);\n```\n\n#### Return\n\n\n`String` --- the URL of the web app\n\n*** ** * ** ***\n\n### `is``Enabled()`\n\nReturns `true` if the script is accessible as a web app.\n\n#### Return\n\n\n`Boolean` --- `true` if the script is published as a web app; `false` if not\n\nDeprecated methods\n------------------\n\n### `disable()`\n\n\n**Deprecated.** This function is deprecated and should not be used in new scripts.\n\nDisables the script from being accessed as a web app. This method is equivalent to opening the\n\"Publish \\\u003e Deploy as web app\" dialog and clicking \"disable web app\".\n\n```javascript\nScriptApp.getService().disable();\n```"]]