Adobe 27510753 Scripting Guide - Page 65

Object statistics, sleep, summary, write

Page 65 highlights

Adobe InDesign CS2 Scripting Guide Using ExtendScript Tools and Features 57 sleep Suspends the calling thread for the given number of milliseconds. $.sleep (milliseconds) Returns undefined. 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. milliseconds The number of milliseconds to wait. summary $.summary ([classname]) Collects a summary of object counts into a table and returns this table as a string. The table shows the number of objects in each specified class. For example: 3 Array 5 String classname Optional. The type of object to count. If not supplied, counts all objects currently defined. write $.write (text[, text...]...) Writes the specified text to the JavaScript Console. Returns undefined. text writeln $.writeln (text[, text...]...) One or more strings to write, which are concatenated to form a single string. Writes the specified text to the JavaScript Console and appends a linefeed sequence. Returns undefined. text One or more strings to write, which are concatenated to form a single string. Object statistics The output from $.list() is formatted as in the following example. Address L 0092196c 4 00976c8c 2 00991bc4 L 1 0099142c L 2 00991294 1 Refs Prop 0 Function 1 Object 1 LOTest 2 Function 0 Object Class [toplevel] Object LOTest LOTest Object Name workspace The columns show the following object information. Address The physical address of the object in memory. L This column contains the letter "L" if the object is a LiveObject (which is an internal data type). Refs The reference count of the object.

  • 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
57
sleep
$.sleep (
milliseconds
)
Suspends the calling thread for the given number of milliseconds.
Returns
undefined
.
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.
milli-
seconds
The number of milliseconds to wait.
summary
$.summary ([
classname
])
Collects a summary of object counts into a table and returns this table
as a string. The table shows the number of objects in each specified
class. For example:
3 Array
5 String
classname
Optional. The type of object to count. If not supplied, counts all objects currently
defined.
write
$.write
(
text
[,
text
...]...)
Writes the specified text to the JavaScript Console. Returns
unde-
fined
.
text
One or more strings to write, which are concatenated to form a single
string.
writeln
$.writeln
(
text
[,
text
...]...)
Writes the specified text to the JavaScript Console and appends a line-
feed sequence. Returns
undefined
.
text
One or more strings to write, which are concatenated to form a single
string.
Object statistics
The output from
$.list()
is formatted as in the following example.
Address
L
Refs
Prop
Class
Name
0092196c
4
0
Function
[toplevel]
00976c8c
2
1
Object
Object
00991bc4 L
1
1
LOTest
LOTest
0099142c L
2
2
Function
LOTest
00991294
1
0
Object
Object
workspace
The columns show the following object information.
Address
The physical address of the object in memory.
L
This column contains the letter “L” if the object is a LiveObject (which is an internal data
type).
Refs
The reference count of the object.