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

get activeDocument through BridgeTalk onResult

Community Beginner ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

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?

 

TOPICS
How-to , Scripting

Views

81

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
Adobe
Community Expert ,
Feb 07, 2024 Feb 07, 2024

Copy link to clipboard

Copied

LATEST

that's not how it works, check the script in this like for a sample onResult usage

 

https://community.adobe.com/t5/illustrator-discussions/illustrator-script-to-get-the-path-item-used-...

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