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 15, 2009

Paul, thanks for looking at this it's no major problem. At least you have proved that I am not totally stupid!!!

When it gets around to upgrades I may well be able to do some thing.


It seems that it is only Photoshop CS2 that has the problem. Everything works in Photoshop CS and CS3 using the script compiled as an app.

If you do upgrade to Photoshop CS4 you should be able to use system() and pass a text file to a shell script ie:

#!/bin/sh

PATH=/usr/ucb:/usr/bin:/bin; export PATH

/usr/bin/osascript < $1

You should be able to send applescript direct to osascript using echo in the system command as well.

It is so much easier on a PC, I had problems working with text files and had to resort to using vim, at least you can see what actually going into your text file.

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?