Class

$

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

QuickLinks

about, bp, clearbp, colorPicker, evalFile, gc, getenv, setbp, sleep, toString, write, writeln

Properties

PropertyTypeAccessDescription
buildnumberreadonlyThe ExtendScript build number.
buildDateDatereadonlyThe ExtendScript build date.
engineNamestringreadonlyThe name of the current ExtendScript engine, if set.
errorErrorr/w

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.

fileNamestringreadonlyThe file name of the current script.
flagsnumberr/w

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.

globalObjectreadonlyA reference to the global object, which contains the JavaScript global namespace.
includePathstringreadonlyThe path for include files for the current script.
levelnumberr/w

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).

localestringr/w

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.

localizeboolr/wSet to true to enable the extended localization features of the built-in toString() method.
memCachenumberr/wThe ExtendScript memory cache size, in bytes.
osstringreadonlyThe current operating system version information.
screensArray of Objectreadonly

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.

stackstringreadonlyThe current stack trace.
strictanyr/w

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.

versionstringreadonly

The version number of the ExtendScript engine.

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

Methods

string about ()
Shows an About box for the ExtendScript component, and returns the text for the box.

void bp (condition:any)
Breaks execution at the current position.

ParameterTypeDescription
condition any 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.

void clearbp ( [line:number=0])
Clears a breakpoint.

ParameterTypeDescription
linenumberThe line number. (default: 0)

number colorPicker (color:number)
Invokes the platform-specific color selection dialog, and returns the selected color.

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

any evalFile (file:File [, timeout:number=10000])
Loads and evaluates a file.

ParameterTypeDescription
fileFileThe file to load.
timeoutnumberAn optional timeout in milliseconds. (default: 10000)

void gc ()
Initiates garbage collection in the ExtendScript engine.

string getenv (name:string)
Retrieves the value of an environment variable.

ParameterTypeDescription
namestringThe name of the variable.

void setbp (line:number, condition:string)
Sets a breakpoint in the current script.

ParameterTypeDescription
linenumberThe line at which to stop execution.
conditionstring

void sleep (msecs:number)
Suspends the calling thread for a number of milliseconds.

ParameterTypeDescription
msecsnumberNumber of milliseconds to sleep.

string toString ()
Converts this object to a string.

void write (text:any)
Prints text to the Console.

ParameterTypeDescription
text any The text to print. All arguments are concatenated.

void writeln (text:any)
Prints text to the Console, and adds a newline character.

ParameterTypeDescription
text any The text to print. All arguments are concatenated.

Contents :: Index