Acrobat JavaScript Tools
Inspect Details Window
2
Inspecting Variables
The
Inspect
details window is a powerful tool that you can use to examine the current state
of JavaScript objects and variables. It enables you to inspect any objects and properties in a
recursive manner within the current stack frame in the debugging session.
To inspect a variable, select
Local Variables
from the
Inspect
drop-down list, which
displays a list of variable and value pairs in the
Inspect
details window. To place a value in a
variable, highlight the variable in the details window (this activates the
Edit
button). Click
the
Edit
button. An
Edit Variable
dialog appears, allowing you to enter a new value for the
variable as shown below in
Figure 2.15.
A triangle next to a name indicates that an object is available for inspection. If you would
like to view its properties, click the triangle to expand the object.
F
IGURE
2.15
Local variable details
Watches
The
Watches
list enables you to customize how variables are inspected. Watches are
JavaScript expressions evaluated when the debugger encounters a breakpoint or a step in
execution. The
Watches
list provides you with the ability to edit, add, or delete watches
using the three buttons just below the
Inspect
details window. All results are displayed in
the
Inspect
details window in the order in which they were created.
To set a watch, select
Watches
from the
Inspect
drop-down list. Click the
New
button, and
a dialog prompts you for the JavaScript variable or expression to be evaluated.
To change the value of a watch, select the watch from the list. Click the
Edit
button, which
displays a dialog prompting you to specify a new expression for evaluation. To delete a
watch, select it from the
Inspect
drop-down list and click the
Delete
button.
Acrobat JavaScript Scripting Guide
57