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

Bridgetalk - multiple versions of Bridge installed

Contributor ,
Jan 24, 2025 Jan 24, 2025

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

TOPICS
Scripting
416
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

correct answers 1 Correct answer

Community Expert , Jan 27, 2025 Jan 27, 2025

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.

 

 

Translate
Advisor ,
Jan 24, 2025 Jan 24, 2025

"it always try to open the newest version to run"

Please would you clarify what you mean by "it"?

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
Contributor ,
Jan 24, 2025 Jan 24, 2025

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;
};

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
Advisor ,
Jan 24, 2025 Jan 24, 2025

I'm afraid that Applescript is outside of my knowledge base. I hope that someone else can assist you.

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
Enthusiast ,
Jan 27, 2025 Jan 27, 2025

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.

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 Expert ,
Jan 27, 2025 Jan 27, 2025

@ExUSA 

 

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.

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
Enthusiast ,
Jan 27, 2025 Jan 27, 2025

Yes a JavaScript can be called from AppleScript.

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 Expert ,
Jan 27, 2025 Jan 27, 2025

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.

 

 

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
Contributor ,
Jan 27, 2025 Jan 27, 2025

Great, this works. Thanks Stephen.

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 Expert ,
Jan 28, 2025 Jan 28, 2025
LATEST
quote

Great, this works. Thanks Stephen.


By @greenrookie


You're welcome!

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