Skip to main content
zeRafio
Inspiring
April 11, 2009
Question

[cs3] Run Applescript from action palelette

  • April 11, 2009
  • 2 replies
  • 3671 views

Everything is in the title.

Any clues?

This topic has been closed for replies.

2 replies

Inspiring
April 11, 2009

I don't use Applescript but I sometimes call VBS from javascript so maybe you can do the same.

Xbytor has a tutorial on File.execute here http://ps-scripts.com/bb/viewtopic.php?t=344 You will find info about OSX near the end of the thread.

Muppet_Mark-QAl63s
Inspiring
April 12, 2009

Michael, I recall taking a look at the posted link once before I was however unable to get it to work with AppleScript. I tried several methods of saving my AppleScript code and non of my efforts worked. If some one does find a working solution do post back as I would like to know where I was going wrong. This is what I had:

var myAppleScript = new File ("/Users/marklarsen/Desktop/Test.scpt");

myAppleScript.execute();

I saved this in Applications/Adobe Photoshop CS2/Presets/Scripts/MarksTest.jsx

I've only just got around to re-reading CoreGuideJS14.pdf to try and get some basic understanding of Javascript.

Paul Riggott
Inspiring
April 13, 2009

Paul, then I am being really thick I have tried saving my AppleScript code in every which way I can think of and get nothing!!!! What AppleScript syntax are you using to test this? I have even wrapped in an on run statement. Thanks.

on run

tell application "Adobe Photoshop CS2"

display dialog "Foo" giving up after 2

end tell

end run


All I did was to use the "New Document" in the samples folder. I opened it in the script editor and did a saveas an app to the desktop. Then used the javascript to call it. Works first time every time

Just a thought, compile your javascript as an app then use this code to try and run it, I have a feeling that your code isn't pointing to the file.

var myAppleScript = File.openDialog("Select File", "All Files:*.*");
myAppleScript.execute();

Muppet_Mark-QAl63s
Inspiring
April 11, 2009

I don't have CS3 only CS2 but you can use the "Inset menu item" from the Actions fly out menu navigate to a loaded script. This works for me with JavaScript.jsx files but I have never been able to get this app to recognise AppleScript files!!!

zeRafio
zeRafioAuthor
Inspiring
April 11, 2009

Thanks, Mark. I know this fonction.

But unfortunately this is only for JavaScripts.

Don't understand why there is this restriction.

Maybe this workaround could make it:

to launch an AppleScript from within a JavaScript.

Some one to give us the code?