Adobe 23101335 - Photoshop - PC Manual page 29

Scripting guide
Hide thumbs Also See for 23101335 - Photoshop - PC:
Table of Contents

Advertisement

Clicking this button displays the
Using the JavaScript Command Line Entry Field
You can use the Script Debugger window's command line entry field to enter and execute
Javascript code interactively within a specified stack scope. Commands entered in this field
execute with a timeout of one second.
clicking the command line entry button or pressing the
The command line entry field accepts any JavaScript code, making it very convenient to use
for inspecting or changing the contents of variables.
N
O T E
Setting Breakpoints In the Script Debugger Window
When the Photoshop Script Debugger window is active, you can double-click a line in the
source view to set or clear a breakpoint at that line. Alternatively, you can click the BP button
to display the Script Breakpoints window and set or clear breakpoints in this window.
Setting Breakpoints in JavaScript Code
Adding the debugger statement to a script sets an unconditional breakpoint. For example, the
following code causes Photoshop to halt and display the script debug window as soon as it
enters the parseBox function.
function getRatio( docRef )
{
debugger;
var theRatio = ( docRef.height ) / ( docRef.width );
return theRatio;
}
alert( getRatio( activeDocument ) );
Photoshop 7.0 Scripting Guide
Script Breakpoints Display
(no keyboard shortcut)
Command line entry field
within the stack scope of the line highlighted in the
you've finished entering the JavaScript expression, you can execute it by
Command line entry button.
code in the command line entry field. Photoshop executes the contents of the command
line entry field within the stack scope of the line highlighted in the
To list the contents of an object as if it were JavaScript source code, enter the
:
object. toSource() command.
Script Breakpoints Window
. Enter in this field a JavaScript statement to execute
Enter
Click this button or press
Scripting basics
Testing and troubleshooting
shown in
Figure
2.2.
view. When
Stack Trace
key.
to execute the JavaScript
Enter
view.
Stack Trace
2
29

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop 7.0

Table of Contents