Testing And Troubleshooting - Adobe PHOTOSHOP CS 2.0 - SCRIPTING GUIDE Manual

Table of Contents

Advertisement

Adobe Photoshop CS2 Scripting Guide
end tell
VBS
Dim appRef As Photoshop.Application
Set appRef = CreateObject("Photoshop.Application")
appRef.DoJavaScriptFile "C:\\Applications\Scripts\JSFile.jsx", _
Array(1, "test text", appRef.ActiveDocument)
When running JavaScript from AppleScript or VBScript you can also control the debugging state. To do
this, use the
NeverShowDebugger
results in a JavaScript exception being thrown.
Note:
DebuggerOnError
and shows the JavaScript debugger.
BeforeRunning
See
'Testing and Troubleshooting' on page 32

Testing and Troubleshooting

The AppleScript and VBScript scripting environments provide tools for monitoring the progress of your
script while it is running—which makes it easier for you to track down any problems your script might be
encountering or causing.
AppleScript Debugging
Apple's Script Editor application provides a syntax checking tool that you can use before you run your
script. Additionally, Script Editor calls out problems in the script when you run the script. To view more
details of how your script runs, display the Event Log and Results windows.
To have Script Editor check your syntax:
1. Click Check Syntax in the Script Editor main window.
Note:
It is possible to create and compile scripts in AppleScript that will not run properly. You can
double-check your syntax by using the Event Log and when you run your script.
To use the Event Log window when you run a script:
1. Choose Controls > Open Event Log.
The Script Editor displays the Event Log window.
2. Select Show Events and Show Events Results.
3. Click Run in the Script Editor main window.
As the script executes, you'll see the commands sent to Photoshop CS2 and the responses.
Note:
show debugger (ExecutionMode)
Disables debugging from the JavaScript. Any error that occurs in the JavaScript
Refer to a JavaScript language guide for information on how to handle JavaScript exceptions.
See
'Bibliography' on page 34
Automatically stops the execution of your JavaScript when a runtime error occurs
Shows the JavaScript debugger at the beginning of your JavaScript.
You can display the contents of one or more variables in the log window by including the
command in your script. Specify the variables you want to display in brackets following the
Photoshop CS2
argument. The values for ExectionMode are:
for a listing of language guides.
for more information about debugging.
Scripting basics
32
log

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Photoshop cs2

Table of Contents