Google uses AI technology to translate content into your preferred language. AI translations can contain errors.
실행 정보
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
실행 중인 스크립트 정보
ExecutionInfo 객체의 메서드를 통해 실행 중인 스크립트의 특정 속성에 액세스할 수 있습니다. 예를 들어 isPreview()은 스크립트가 현재 미리보기 중인지 아니면 실제로 실행 중인지 알려줍니다.
이렇게 하면 코드 디버깅이 간소화되는 경우가 많습니다.
// Code that generates a report.
// ...
if (!AdsApp.getExecutionInfo().isPreview()) {
// Do not email the report when in preview mode!
MailApp.sendEmail("customer@example.com", "Report is ready!", report);
}
스크립트 계정 정보
실행 중인 스크립트의 계정 정보가 필요한 경우가 많으며, 특히 변경되지 않은 동일한 스크립트가 여러 계정에서 사용되는 경우에 그렇습니다. 스크립트에서 보고서를 이메일로 전송하는 경우 수신자는 발신 계정을 식별해야 합니다. 이를 위해 Account 객체의 getCustomerId() 메서드를 사용할 수 있습니다.
let accountId = AdsApp.currentAccount().getCustomerId();
MailApp.sendEmail("customer@example.com",
"Report is ready for " + accountId, report);
Account 객체에는 계정의 통화와 시간대를 식별할 수 있는 메서드도 있습니다.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-10-11(UTC)
[[["이해하기 쉬움","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"]],["최종 업데이트: 2025-10-11(UTC)"],[],[]]