Skip to main content
Participant
June 29, 2006
Question

What is the correct usage for a "photoshop.executeScript"

  • June 29, 2006
  • 2 replies
  • 617 views
I am scripting in javascript on a Mac OSX machine with Bridge 1.0.4.6.

I am trying to execute a Photoshop Javascript file from within Bridge, but I have been, as of yet, unsuccessful. I am attempting to use the photoshop.executeScript command with a string value of the photoshop script, but all that happens is that photoshop comes up and my script is not launched.

Inside of my Bridge script, I call the executeScript like this:

var file = new File( "~/Desktop/test.jsx" );
file.open( "r" );
var buffer = file.read();
file.close();
photoshop.executeScript( buffer );

And the ~/Desktop/test.jsx file looks like:

var file = File.openDialog('Image to test');
var fileRef = new File(file);
var docRef = open (fileRef);

If you have any suggestions, please let me know.
Thank you.

Evan Appleby
Sony Pictures Imageworks
This topic has been closed for replies.

2 replies

July 7, 2006
I've never had any success getting photoshop.executeScript to work.

It's better just to send a bridgetalk message yourself.

Personally, if you're attempting to do a relatively small operation on a set of files, I would look at the BridgeTalkIterator class in AdobeLibrary1.jsx.

There is an example of how to use it on AdobeExchange. It's a simple script called "open close" or something like that. You can easily modify it by simply changing the photoshop script to whatever it is you need.

The benefits - it works around a bridgetalk bug in starting the target application and it also puts up a progress meter in Bridge.

Bob
Participant
July 7, 2006
Does anyone know how to correctly use the photoshop.executeScript command?
Thanks for your help.

Evan Appleby
Sony Pictures Imageworks