Copy link to clipboard
Copied
Hi wizards,
If I have multiple versions of Bridge installed (2024, 2025), it always try to open the newest version to run.
Is there a way to target a specific version?
Thanks in advance
1 Correct answer
I believe that you can target a specific app version with code similar to:
bt.target = "bridge-12"; // version 2022
Where you will need to escape the quotes if using AppleScript.
Copy link to clipboard
Copied
"it always try to open the newest version to run"
Please would you clarify what you mean by "it"?
Copy link to clipboard
Copied
Hi, the 'it' is a an applescript droplet (clickable app). Here's the code I'm running thanks (within an Applescript, so quotation marks are escaped). I have Bridge 2024 open, but I click the droplet, it will try to open Bridge 2025 (which is installed but not running). If I have 2025 version running, it will work fine. Thanks.
#target photoshop;
var DD = decodeURI(GetFilesFromBridge().join('\\n')); //decode Hexadecimal characters
var XX = decodeURI(DD); //decode Hexadecimal characters??
var YY = XX.replace(/(\\/)/g,\"\"); //remove foward slash at beginning of filename
//alert (YY);
function GetFilesFromBridge() {
function script(){
var fL = app.document.selections;
var tF=[];
for(var a in fL){
if(fL[a].type =='file'){
tF.push(new File(decodeURI(fL[a].spec.name)));
}
}
return tF.toSource();
}
var fileList;
var bt = new BridgeTalk();
bt.target = \"bridge\";
bt.body = \"var ftn = \" + script.toSource() + \"; ftn();\";
bt.onResult = function( inBT ) { fileList = eval( inBT.body ); }
bt.onError = function( inBT ) { fileList = new Array(); }
bt.send(8);
bt.pump();
if ( undefined == fileList ) fileList = new Array();
return fileList;
};
Copy link to clipboard
Copied
I'm afraid that Applescript is outside of my knowledge base. I hope that someone else can assist you.
Copy link to clipboard
Copied
That's not AppleScript, that's JavaScript. You can try changing the bridge variable to point to the specific application bundle you want to use.
Copy link to clipboard
Copied
From what @greenrookie has written, the ExtendScript/JavaScript code is being called from AppleScript, such as:
tell application "Adobe Photoshop 2024"
set js to "alert( \"Hellow World!\" );"
do javascript js
end tell
Where the JS double-quotes within the AS double-quotes need to be escaped.
Copy link to clipboard
Copied
Yes a JavaScript can be called from AppleScript.
Copy link to clipboard
Copied
I believe that you can target a specific app version with code similar to:
bt.target = "bridge-12"; // version 2022
Where you will need to escape the quotes if using AppleScript.
Copy link to clipboard
Copied
Great, this works. Thanks Stephen.
Copy link to clipboard
Copied
Great, this works. Thanks Stephen.
By greenrookie
You're welcome!

