Adobe 27510753 Scripting Guide - Page 55

Tracking data, Boolean, Number, String, Object, Invalid object - photoshop

Page 55 highlights

Adobe InDesign CS2 Scripting Guide Using ExtendScript Tools and Features 47 Tracking data The Data Browser tab is your window into the JavaScript engine. It displays all live data defined in the current context, as a list of variables with their current values. If execution has stopped at a breakpoint, it shows variables that have been defined using var in the current function, and the function arguments. To show variables defined in the global or calling scope, use the Call Stack to change the context (see "The call stack"). You can use the Data Browser to examine and set variable values. l Click a variable name to show its current value in the edit field at the top of the tab. l To change the value, enter a new value and press enter. If a variable is read-only, the edit field is disabled. Display or modify selected variable's value Object opened to show properties The flyout menu for this tab lets you control the amount of data displayed: l Show Global Functions toggles the display of all global function definitions. l Show Object Methods toggles the display of all functions that are attached to objects. Most often, the interesting data in an object are its callable methods. l Show JavaScript Language Elements toggles the display of all data that is part of the JavaScript language standard, such as the Array constructor or the Math object. An interesting property is the _ _ proto _ _ property, which reveals the JavaScript object prototype chain. Each variable has a small icon that indicates the data type. An invalid object is a reference to an object that has been deleted. If a variable is undefined, it does not have an icon. null Boolean Number String Object Invalid object You can inspect an object's content by clicking its icon. The list expands to show the object's properties (and methods, if Show Object Methods is enabled); the triangle points down to indicate that the object is open. Note: In Photoshop® CS2, the Data Browser pane is populated only during the debugging of a JavaScript program within Photoshop.

  • 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
47
Tracking data
The Data Browser tab is your window into the JavaScript engine. It displays all live data defined in the current
context, as a list of variables with their current values. If execution has stopped at a breakpoint, it shows
variables that have been defined using
var
in the current function, and the function arguments. To show
variables defined in the global or calling scope, use the Call Stack to change the context (see
“The call stack”).
You can use the Data Browser to examine and set variable values.
Click a variable name to show its current value in the edit field at the top of the tab.
To change the value, enter a new value and press enter. If a variable is read-only, the edit field is disabled.
Display or modify selected variable’s value
Object opened to show properties
The flyout menu for this tab lets you control the amount of data displayed:
Show Global Functions toggles the display of all global function definitions.
Show Object Methods toggles the display of all functions that are attached to objects. Most often, the
interesting data in an object are its callable methods.
Show JavaScript Language Elements toggles the display of all data that is part of the JavaScript language
standard, such as the Array constructor or the Math object. An interesting property is the
_ _ proto _ _
property, which reveals the JavaScript object prototype chain.
Each variable has a small icon that indicates the data type. An invalid object is a reference to an object that
has been deleted. If a variable is undefined, it does not have an icon.
null
Boolean
Number
String
Object
Invalid object
You can inspect an object's content by clicking its icon. The list expands to show the object’s properties (and
methods, if Show Object Methods is enabled); the triangle points down to indicate that the object is open.
Note:
In Photoshop® CS2, the Data Browser pane is populated only during the debugging of a JavaScript
program within Photoshop.
l
l
l
l
l