Skip to main content
hiro-e
Participant
February 8, 2024
Question

get activeDocument through BridgeTalk onResult

  • February 8, 2024
  • 1 reply
  • 197 views
var bt = new BridgeTalk();
bt.target = BridgeTalk.appSpecifier;
bt.body = 'targetFunction();';
bt.onResult = function(resObj){
	doc = app.activeDocument;
	grp = doc.groupItems;
	for(var i=0; i<grp.length; i++){
	// loop for groupitems
	}
	palette.layout.layout(true);
	palette.show();
};
bt.send();

I am creating a script for redrawing a palette in Script UI.

However, when I try to access the activeDocument within the BridgeTalk.onResult callback, it doesn't work. It seems like the rest of the script is functioning properly. How can I make this work?

 

This topic has been closed for replies.

1 reply

CarlosCanto
Community Expert
Community Expert
February 8, 2024