Adobe 27510753 Scripting Guide - Page 63

Dollar ($) Object, Dollar ($) object properties

Page 63 highlights

Adobe InDesign CS2 Scripting Guide Using ExtendScript Tools and Features 55 Dollar ($) Object This global ExtendScript object provides a number of debugging facilities and informational methods. The properties of the $ object allow you to get global information such as the most recent run-time error, and set flags that control debugging and localization behavior. The methods allow you to output text to the JavaScript Console during script execution, control execution and other ExtendScript behavior programmatically, and gather statistics on object use. Dollar ($) object properties build Number The ExtendScript build number. Read only. buildDate Date The date ExtendScript was built. Read only. error Error String The most recent run-time error information, contained in a JavaScript Error object. flags global Number Object 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. Gets or sets low-level debug output flags. A logical AND of the following bit flag values: l 0x0002 (2): Displays each line with its line number as it is executed. l 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. l 0x0080 (128): Displays all calls with their arguments and the return value. l 0x0100 (256): Enables extended error handling (see the strict property). l 0x0200 (512): Enables the localization feature of the toString method. Equivalent to the localize property. Provides access to the global object, which contains the JavaScript global namespace. level locale Number String Enables or disables the JavaScript debugger. One of: l 0: No debugging l 1: Break on runtime errors l 2: Full debug mode 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 Enables or disables the extended localization features of the built-in toString method. See the " Localizing ExtendScript Strings" section. memCache Number Gets or sets the ExtendScript memory cache size in bytes.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184

Adobe InDesign CS2 Scripting Guide
Using ExtendScript Tools and Features
55
Dollar ($) Object
This global ExtendScript object provides a number of debugging facilities and informational methods.
The properties of the
$
object allow you to get global information such as the most recent run-time error,
and set flags that control debugging and localization behavior. The methods allow you to output text
to the JavaScript Console during script execution, control execution and other ExtendScript behavior
programmatically, and gather statistics on object use.
Dollar ($) object properties
build
Number
The ExtendScript build number. Read only.
buildDate
Date
The date ExtendScript was built. Read only.
error
Error
String
The most recent run-time error information, contained in a JavaScript
Error
object.
Assigning error text to this property generates a run-time error; however, the pre-
ferred way to generate a run-time error is to throw an
Error
object.
flags
Number
Gets or sets low-level debug output flags. A logical AND of the following 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 the
strict
property).
0x0200
(512): Enables the localization feature of the
toString
method.
Equivalent to the
localize
property.
l
l
l
l
l
global
Object
Provides access to the global object, which contains the JavaScript global
namespace.
level
Number
Enables or disables the JavaScript debugger. One of:
0: No debugging
1: Break on runtime errors
2: Full debug mode
l
l
l
locale
String
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
Enables or disables the extended localization features of the built-in
toString
method. See the “ Localizing ExtendScript Strings” section.
memCache
Number
Gets or sets the ExtendScript memory cache size in bytes.