Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Jun 29, 2006 Jun 29, 2006
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
TOPICS
Scripting
558
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2006 Jul 07, 2006
Does anyone know how to correctly use the photoshop.executeScript command?
Thanks for your help.

Evan Appleby
Sony Pictures Imageworks
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2006 Jul 07, 2006
LATEST
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
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines