Skip to main content
Participant
August 4, 2020
Question

Bridgetalk script no longer working on 2020

  • August 4, 2020
  • 1 reply
  • 359 views

Hi, so I recently upgraded to the 2020 creative cloud from cs6, I have this script that communicates with photoshop to do a very specific mockup of a candy wrapper.

 

However since the upgrade it won't really do anything on the photoshop side of things anymore, it works until photoshop opens up, which it does, then nothing happens.

 

Here is a snippet of my code up until it's supposed to open a specific document:

 
app.activeDocument.layers["Tryck"].hasSelectedArtwork = true;
app.executeMenuCommand('copy');

 
btMessaging'photoshop',psScript );  
  
function btMessagingtargetAppscript ) {  
          var bt = new BridgeTalk();  
          bt.target = targetApp;  
          bt.body = script;  
          bt.send1 );  
};

 
var scriptPath = (new File($.fileName)).path 
var aiFile = File(scriptPath + '/mockup/mockup.psd');
var aiFile2 = File(scriptPath + '/mockup/mockupdone.psd');
  
var psScript = 'app.displayDialogs = DialogModes.NO;';  
  
 
psScript += 'app.open(' + aiFile.toSource() + ');';
 
Of course it continues on to do other stuff with additional psScript += lines which are not included, but it won't even do this first simple step of opening the correct document anymore...

 

This topic has been closed for replies.

1 reply

Participant
August 4, 2020

Ok, now I'm really baffled.

 

I altered the script to run the photoshop part externally. i.e:

var scriptPath = (new File($.fileName)).path 
app.activeDocument.layers["Tryck"].hasSelectedArtwork = true;
app.executeMenuCommand('copy');

var scriptToLoad = new File (scriptPath + "/psScript.jsx"// the script to load
try {
    if (!scriptToLoad.exists) { throw new Error("script not found!"); }
    scriptToLoad.open ("r"); // read only
    var message = scriptToLoad.read();
    scriptToLoad.close()
catch (error) {
    alert("Error parsing the file: " + error.description);
}
var bt = new BridgeTalk();
bt.target = "photoshop";
bt.body = message;
bt.send();
 
and in my psScript.jsx I have:
var scriptPath = (new File($.fileName)).path 
var fileRef = new File(scriptPath + "/mockup/mockup.psd")
app.open (fileRef)
 
If I run the psScript.jsx by itself it opens up the document just fine, however, when I run it through bridgetalk it wont open up unless I use a direct path like C:\mockup\mockup.psd.
But this needs to be able to run on several computers so i need to use the $.filename method.
 
This is really weirding me out...