## Information about a running script

You can access certain attributes of a running script through the methods of the
[`ExecutionInfo`](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_executioninfo)
object. For example,
[`isPreview()`](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_executioninfo#isPreview)
tells you whether a script is being previewed or is actually executing.

This often simplifies debugging code:

    // 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);
    }

## Information about a script's account

Account information for a running script is often needed, especially when the
same unchanged script is used in multiple accounts. If the script is emailing
out a report, the recipient needs to identify the originating account. You can
use the
[`Account`](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_account)
object's
[`getCustomerId()`](https://developers.google.com/google-ads/scripts/docs/reference/adsapp/adsapp_account#getCustomerId)
method for this:

    let accountId = AdsApp.currentAccount().getCustomerId();
    MailApp.sendEmail("customer@example.com",
        "Report is ready for " + accountId, report);

The `Account` object also has methods to let you identify the account's
currency and time zone.