Specifications

Return value in case of errorReturn value in case of successAction
Error message starting with
"/ERROR/:"
The string "/OK/"Command
Error message starting with
"/ERROR/:"
Absolute path of output file or job
folder (*)
Save as
(*) use the methods offered by the Job class (part of the Switch scripting API) to obtain a temporary
output location.
Referring to Switch
If your custom script does not use any of the methods in the Switch scripting API then you may
save it as a plain text file or as a compiled script (the latter is slightly more efficient).
However if your custom script does use any of the methods in the Switch scripting API then you
need a special construct to ensure that AppleScript can access the Switch dictionary at
compile-time, and that the commands are sent to the appropriate Switch server at run-time:
Use the following code for referring to the Switch server from a tell statement:
using terms from application "PowerSwitch_Service" tell application
(server of args) ... end tellend using terms from
Replace "PowerSwitch_Service" by "FullSwitch_Service" if you do not have PowerSwitch
installed.
Save your script as a compiled script.
Examples of AppleScripts for applications
Open script: use document preferences
To open a document using document preferences, specify the following as a custom "open" script
and enter "yes" for the first argument.
on run {args}
set theJobPath to infile of args
set theDocPrefs to arg1 of args
set scriptResult to "/OK/"
tell application "QuarkXPress"
try
if (theDocPrefs is equal to "yes") then
open alias theJobPath use doc prefs yes remap fonts no do auto picture import no
else
open alias theJobPath use doc prefs no remap fonts no do auto picture import no
end if
on error errmsg number errnum
set scriptResult to ("/ERROR/:" & errmsg)
end try
end tell
207
Enfocus Switch 10