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

Bridgetalk - multiple versions of Bridge installed

Contributor ,
Jan 24, 2025 Jan 24, 2025

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

TOPICS
Scripting

Views

309
Translate

Report

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.

 

 

Votes

Translate
Advisor ,
Jan 24, 2025 Jan 24, 2025

Copy link to clipboard

Copied

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

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

Votes

Translate

Report

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

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

Votes

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Report

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

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.

Votes

Translate

Report

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

Copy link to clipboard

Copied

@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.

Votes

Translate

Report

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

Copy link to clipboard

Copied

Yes a JavaScript can be called from AppleScript.

Votes

Translate

Report

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

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.

 

 

Votes

Translate

Report

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

Copy link to clipboard

Copied

Great, this works. Thanks Stephen.

Votes

Translate

Report

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

Copy link to clipboard

Copied

LATEST
quote

Great, this works. Thanks Stephen.


By greenrookie


You're welcome!

Votes

Translate

Report

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