$

The $ object provides a number of debugging facilities and informational methods.

Methods:

about, bp, colorPicker, evalFile, gc, getenv, setenv, sleep, toString, write, writeln

Property Listing

Name

Type

Access

Description

build

String

readonly

The ExtendScript build information.

buildDate

Date

readonly

The ExtendScript build date.

decimalPoint

String

readonly

The character used as the decimal point character in formatted numeric output.

engineName

String

readonly

The name of the current ExtendScript engine, if set.

error

Error

readonly

The most recent run-time error information.

Assigning error text to this property generates a run-time error; however, the preferred way to generate a run-time error is to throw an Error object.

fileName

String

readonly

The file name of the current script.

flags

Number

readonly

Gets or sets low-level debug output flags.

A logical AND of bit flag values: 0x0002 (2): Displays each line with its line number as it is executed. 0x0040 (64): Enables excessive garbage collection. Usually, garbage collection starts when the number of objects has increased by a certain amount since the last garbage collection. This flag causes ExtendScript to garbage collect after almost every statement. This impairs performance severely, but is useful when you suspect that an object gets released too soon. 0x0080 (128): Displays all calls with their arguments and the return value. 0x0100 (256): Enables extended error handling (see strict). 0x0200 (512): Enables the localization feature of the toString method. Equivalent to the localize property.

global

Object

readonly

A reference to the global object, which contains the JavaScript global namespace.

hiresTimer

Number

readonly

A high-resolution timer, measuring the time in microseconds. The timer starts when ExtendScript is initialized during the application startup sequence. Every read access resets the timer to Zero.

includePath

String

readonly

The path for include files for the current script.

level

Number

readonly

The current debugging level, which enables or disables the JavaScript debugger.

One of 0 (no debugging), 1 (break on runtime errors), or 2 (full debug mode).

line

Number

readonly

The current line number of the currently executing script.

locale

String

readonly

Gets or sets the current locale.

The string contains five characters in the form LL_RR, where LL is an ISO 639 language specifier, and RR is an ISO 3166 region specifier.Initially, this is the value that the application or the platform returns for the current user. You can set it to temporarily change the locale for testing. To return to the application or platform setting, set to undefined, null, or the empty string.

localize

Boolean

readonly

Set to true to enable the extended localization features of the built-in toString() method.

memCache

Number

readonly

The ExtendScript memory cache size, in bytes.

os

String

readonly

The current operating system version information.

screens

Array of Object

readonly

An array of objects containing information about the display screens attached to your computer.

Each object has the properties left, top, right, bottom, which contain the four corners of each screen in global coordinates.A property primary is true if that object describes the primary display.

stack

String

readonly

The current stack trace.

strict

Varies

readonly

Sets or clears strict mode for object modification.

When true, any attempt to write to a read-only property causes a runtime error. Some objects do not permit the creation of new properties when true.

version

String

readonly

The version number of the ExtendScript engine.

Formatted as a three-part number and description; for example: "3.92.95 (debug)".

Method Listing

String about ()

Shows an About box for the ExtendScript component, and returns the text for the box.

undefined bp ([condition:Varies])

Breaks execution at the current position.

Parameter

Type

Description

condition

Varies

A string containing a JavaScript statement to be used as a condition. If the statement evaluates to true or nonzero when this point is reached, execution stops.

Number colorPicker (color:Number)

Invokes the platform-specific color selection dialog, and returns the selected color.

Parameter

Type

Description

color

Number

The color to be preselected in the dialog, as 0xRRGGBB, or -1 for the platform default.

Varies evalFile (file:File, [timeout:Number=Number])

Loads and evaluates a file.

Parameter

Type

Description

file

File

The file to load.

timeout

Number

An optional timeout in milliseconds.

(default: 10000)

undefined gc ()

Initiates garbage collection in the ExtendScript engine.

String getenv (name:String)

Retrieves the value of an environment variable.

Parameter

Type

Description

name

String

The name of the variable.

undefined setenv (name:String, value:String)

Sets the value of an environment variable.

Parameter

Type

Description

name

String

The name of the variable.

value

String

The value of the variable.

undefined sleep (msecs:Number)

Suspends the calling thread for a number of milliseconds.

During a sleep period, checks at 100 millisecond intervals to see whether the sleep should be terminated. This can happen if there is a break request, or if the script timeout has expired.

Parameter

Type

Description

msecs

Number

Number of milliseconds to sleep.

String toString ()

Converts this object to a string.

undefined write (text:Varies)

Prints text to the Console.

Parameter

Type

Description

text

Varies

The text to print. All arguments are concatenated.

undefined writeln (text:Varies)

Prints text to the Console, and adds a newline character.

Parameter

Type

Description

text

Varies

The text to print. All arguments are concatenated.