Photoshop CS2
Adobe Photoshop CS2 Scripting Guide
Scripting basics 32
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
show debugger (
ExecutionMode
)
argument. The values for
ExectionMode
are:
●
NeverShowDebugger
Disables debugging from the JavaScript. Any error that occurs in the JavaScript
results in a JavaScript exception being thrown.
Note:
Refer to a JavaScript language guide for information on how to handle JavaScript exceptions.
See
‘Bibliography’ on page 34
for a listing of language guides.
●
DebuggerOnError
Automatically stops the execution of your JavaScript when a runtime error occurs
and shows the JavaScript debugger.
●
BeforeRunning
Shows the JavaScript debugger at the beginning of your JavaScript.
See
‘Testing and Troubleshooting’ on page 32
for more information about debugging.
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:
You can display the contents of one or more variables in the log window by including the
log
command in your script. Specify the variables you want to display in brackets following the
Содержание PHOTOSHOP CS 2.0 - SCRIPTING GUIDE
Страница 1: ...bbc Adobe Photoshop cs 2 Scripting Guide ...