Skip to main content
Known Participant
September 21, 2005
Question

Opening a Script in PS from Bridge

  • September 21, 2005
  • 11 replies
  • 1191 views
The following script was (severely) hacked from Bob's OpenClose_PS.jsx. It is called from Bridge and runs the target script in Photoshop. It seems to work even with complex scripts that go from Photoshop back to Bridge to do more things in Bridge.

#target bridge

function getScript ( ) {

var scp = "remoteScript = " + remoteScript + "\n";

scp += "remoteScript();";

return scp;

}



function remoteScript ( ) {

var f = new File ('/c/Program Files/Adobe/Adobe Photoshop CS2/Presets/Scripts/ah-rawprocessor1.js');

if (f.open('r')) {

var sStr = f.read();

}

else throw('failed to open script'+f.fsName);

eval(sStr);

}



function runScript ( ) {

var bt = new BridgeTalk ();

var theScript = getScript();

bt.target = "photoshop";

bt.body = theScript;

bt.send();

}



runScript();


BUT I do not understand what is going on in the first line of the getScript function - or perhaps in the whole of that function. I would like to understand it better and as part of that find a way to specify the target script path within the runscript() call ie runScript(targetScript);

Andrew
This topic has been closed for replies.

11 replies

Known Participant
September 22, 2005
I still haven't got my head around

var scp = "remoteScript = " + remoteScript + "\n";
scp += "remoteScript();";

But I have made a template script for running PS scripts from Bridge:

http://www.ps-scripts.com/bb/viewtopic.php?t=186

I'm sure it will be improved on as my understanding improves.

Andrew