Hi, new AppleScripter here . . .
I’m trying to use AppleScript to run Photoshop CS2 and run a JavaScript in Photoshop using a variable passed from the AppleScript.
For example:
CODE
Applescript determines FilePath X and stores it in variable myVarAS
AppleScript tells Photoshop to
do JavaScript "
var myVar = ’ " & myVarAS & " ’
scriptaction( myVar )
function scriptaction( myVar)
{
javacode ‘blah, blah, blah’
save file in filepath ( myVar )
}
"
END CODE
I’m pretty sure I can get this to work, if one of you guys would tell me how to pass the variable from AppleScript to JavaScript!
If I hard card the path in the JavaScript, it writes the WBMP file just fine. But no matter what I try, I can’t get the JavaScript to recognize the variable!
Is there some secret code or magic mumbo-jumbo I have to write, or can I only perform this rite on new moons or something?
What gives?
Adobe’s guide recommends the “do javascript” with an external script. But this would make implementing over many workstations a task, due to the need of copying and linking two files, maybe even customizing for each workstation. Besides, that doesn’t work, either!!!
So my desired solution is to include the java code in my applescript. I just need it to work!
Any help would be appreciated!
Thank you.