Question
How to get result from BridgeTalk message?
Dear all,
I want to add a new function to my preflight script which should check color settings chosen in Photoshop. My major problem is that I cant get result outside of bt.onResult function.
Here is where I got so far:
It writes myResult1 variable to console as expected, but myResult2 is undefined. Why?
Another question:
Ive been experimenting with BridgeTalk for some time and found out a strange phenomenon. When I send a BridgeTalk message, lets say, from InDesign to Photoshop in main target engine this script doesnt work, but when in session or a custom one it works. Why so?
I want to explore the possibilities of interapplication communication for a long time. But I cant get reliable information on this topic. Ive read Interapplication Communication with Scripts chapter in JavaScript Tools Guide several times but I couldnt get the example scripts (in Communicating Through Messages section) working.
Ive found a few examples in Adobe Bridge CS3 SDK: SnpSendArray.jsx, SnpSendMessageToInDesign.jsx etc. They work like a charm but their code is hard for me to understand Im not a programmer by background.
So, I have two favors to ask of you:
1st Could someone give me complete and working examples, similar to given in Communicating Through Messages section?
2nd Could somebody explain to me, in simple terms , some example from Bridge CS3 SDK?
Thanks in advance.
Kasyan
I want to add a new function to my preflight script which should check color settings chosen in Photoshop. My major problem is that I cant get result outside of bt.onResult function.
Here is where I got so far:
#target indesign-5.0
#targetengine "session"
var myResult2 = infoFromPS();
$.writeln("myResult2 = " + myResult2);
function infoFromPS() {
var bt = new BridgeTalk;
bt.target = "photoshop";
bt.body = "app.colorSettings;"
bt.onResult = function(resObj) {
var myResult1 = resObj.body;
$.writeln("myResult1 = " + myResult1);
return myResult1;
}
bt.send();
}
It writes myResult1 variable to console as expected, but myResult2 is undefined. Why?
Another question:
Ive been experimenting with BridgeTalk for some time and found out a strange phenomenon. When I send a BridgeTalk message, lets say, from InDesign to Photoshop in main target engine this script doesnt work, but when in session or a custom one it works. Why so?
I want to explore the possibilities of interapplication communication for a long time. But I cant get reliable information on this topic. Ive read Interapplication Communication with Scripts chapter in JavaScript Tools Guide several times but I couldnt get the example scripts (in Communicating Through Messages section) working.
Ive found a few examples in Adobe Bridge CS3 SDK: SnpSendArray.jsx, SnpSendMessageToInDesign.jsx etc. They work like a charm but their code is hard for me to understand Im not a programmer by background.
So, I have two favors to ask of you:
1st Could someone give me complete and working examples, similar to given in Communicating Through Messages section?
2nd Could somebody explain to me, in simple terms , some example from Bridge CS3 SDK?
Thanks in advance.
Kasyan
