एक्ज़ीक्यूशन की जानकारी
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
चल रही स्क्रिप्ट के बारे में जानकारी
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 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-06-03 (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-06-03 (UTC) को अपडेट किया गया."],[[["Access attributes of a running script using the `ExecutionInfo` object, such as determining if the script is in preview mode with `isPreview()`."],["Utilize the `Account` object to retrieve account information like customer ID (`getCustomerId()`), currency, and time zone, particularly useful when a single script operates across multiple accounts."],["Simplify debugging and reporting by conditionally executing code based on the script's execution mode and including account-specific details in outputs like emails."]]],[]]