Skip to main content
동후김83505835
Known Participant
July 3, 2017
Question

Is there a way to run a jsx file from within a plugin?

  • July 3, 2017
  • 1 reply
  • 1124 views

Is there a way to run a jsx file from within a plugin?

I want to run the jsx file directly rather than running the script string.

Also, during execution of the jsx file, the plugin will wait and be able to receive the results.

This topic has been closed for replies.

1 reply

Tom Ruark
Inspiring
July 31, 2017

Here is JavaScript for playing JavaScript. You can convert the ActionDescriptor code to C/C++ and run it in Getter or Listener example.

var id4 = stringIDToTypeID( "AdobeScriptAutomation Scripts" );

    var desc2 = new ActionDescriptor();

    var id5 = charIDToTypeID( "jsCt" );

    desc2.putPath( id5, new File( "C:\\Users\\tr\\JavaScripts\\HelloAlert.jsx" ) );

    var id6 = charIDToTypeID( "jsMs" );

    desc2.putString( id6, "hello" );

var a = executeAction( id4, desc2, DialogModes.NO );

There is also the JavaScript suite you can acquire in an automation plugin and execute JavaScripts that way.

Not sure about the return values. You might have to store/retrieve from the Photoshop registry but I think the last thing you have in your script should get returned in the ActionDescriptor from the play command in C/C++.