Highlighted

Having trouble with the onReceived command using BridgeTalk

Explorer ,
May 26, 2020

Copy link to clipboard

Copied

I have a larger script but trying to solve it on a smaller scale before I put it in. I can get .onResult working when I put the varible I want at the end of the body script but when I try .onReceived it triggers function but the flag.body is empty. I have tried wrapping the body msg in different varients of " , ' and +s to no avail any help would be appreciated.

 

 

var bt = new BridgeTalk();
var specifer =BridgeTalk.getSpecifier('photoshop');
bt.target = specifer;

var psScript = "\
        var flag = true;\
        var bt = new BridgeTalk();\
        var specifer = BridgeTalk.getSpecifier('aftereffects');\
        bt.target = specifer;\
        if(flag == true){\
            bt.body = 'Hello World';\
        }else bt.body = 'Goodbye World';\
        bt.send();\
        photoshop.quit();\
"
bt.body = psScript;
bt.onReceived = function resultReceived(flag){
        alert(flag.body);
}
bt.send();

 

 

Edit: changed my alert to a $.write and it show the info I'm getting is <![CDATA[]]> so now googling that to see if I can read from it. 

 

Topics

Scripting

Views

165

Likes

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

Having trouble with the onReceived command using BridgeTalk

Explorer ,
May 26, 2020

Copy link to clipboard

Copied

I have a larger script but trying to solve it on a smaller scale before I put it in. I can get .onResult working when I put the varible I want at the end of the body script but when I try .onReceived it triggers function but the flag.body is empty. I have tried wrapping the body msg in different varients of " , ' and +s to no avail any help would be appreciated.

 

 

var bt = new BridgeTalk();
var specifer =BridgeTalk.getSpecifier('photoshop');
bt.target = specifer;

var psScript = "\
        var flag = true;\
        var bt = new BridgeTalk();\
        var specifer = BridgeTalk.getSpecifier('aftereffects');\
        bt.target = specifer;\
        if(flag == true){\
            bt.body = 'Hello World';\
        }else bt.body = 'Goodbye World';\
        bt.send();\
        photoshop.quit();\
"
bt.body = psScript;
bt.onReceived = function resultReceived(flag){
        alert(flag.body);
}
bt.send();

 

 

Edit: changed my alert to a $.write and it show the info I'm getting is <![CDATA[]]> so now googling that to see if I can read from it. 

 

Topics

Scripting

Views

166

Likes

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

Have something to add?

Join the conversation