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

BridgeTalk not working in .jsxbin

Advisor ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

Hello,

when runnung this in the jsx file it works just fine but in a jsxbin file nothing seems to happen.

Does anyone here know what would need to be changed for this to work in a .jsxbin file?

CreateBridgeTalkMessage({file: myFile.toSource(),});

function CreateBridgeTalkMessage() {
    var bt = new BridgeTalk();
      bt.target = "photoshop";
      bt.body = "var myFile = File(\"" + myFile + "\");";
      bt.body += "var myPublishFolder = Folder(\"" + doc.filePath.parent + '/Final_Deliverables/Publish/'+ "\");";
      bt.body += "raster =" + raster.toString() + "\rraster();";
      bt.onError = function(errObj) {
      $.writeln("Error: " + errObj.body);
     };
   bt.send(100);
}

Regards,

Mike

TOPICS
Actions and scripting

Views

910

Translate

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
Valorous Hero ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

What exactly do you have "works just fine"?
Your function is declared without arguments, and you call it with a parameter.
Also what is (where defined) myFile, doc, raster ?
 
And in general, what result do you expect from this code?
 
 

Votes

Translate

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 ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

Hello @r-bin,

 

I should have been more clear, I have a .jsx file that exports a pdf "myFile" from Indesign and then BridgeTalk tells Photoshop to open the pdf, and save it back out as a rastered pdf to a location. This all works in the .jsx file but when I save as a .jsxbin file it only works until the BridgeTalk part. I don't get any error message except from Indesign when it checks to see if the rastered pdf exist or not. I only included the BridgeTalk portion that seems to break in the .jsxbin file.

 

Regards,

Mike

Votes

Translate

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 ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

Votes

Translate

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 ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

Hello @Stephen_A_Marsh,

 

Thanks for the post... I looked at the link https://www.davidebarranca.com/2013/09/bridgetalk-export-as-binary-failures/ for a solution, the workaround otption to "move the separate function out of the binary encoding and leave it readable" won't work for me as this is just a small part of a very long script that's more than 1,300 lines of code. I believe you either have to remove the line breaks or add the \ at the end of each line in the binary encoding.

 

The workaround otption to "stringify the function" looks promising but I haven't had any success getting it to work.

 

Regards,

Mike

 

Votes

Translate

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
Guide ,
May 01, 2023 May 01, 2023

Copy link to clipboard

Copied

LATEST

Have you tried to figure out what gets into bt.body? It would be useful to print the contents to the console, or save it to a jsx file (and try to execute it in photoshop manually).

Votes

Translate

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