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

How to change Edit context?

New Here ,
Dec 03, 2018 Dec 03, 2018

Hi, I want to traverse the whole document to look for specific nodes such as text to change them to outlines.

But I am failing because I cannot select text that is inside a group that is a part of the Artboard.

function deepSearchGroups(selection, node) {

  selection.items = node;
   node.children.forEach(subnode => {

   if(subnode instanceof Group) {

  selection.items = subnode;
   let subTexts = subnode.children.filter(subnodeChild => {

   return subnodeChild instanceof Text;
   });
   subTexts.forEach(subText => {

   selection.items = subText;
   commands.convertToPath();
   });
   deepSearchGroups(subnode);
   }

  });
}

Message I am getting tells me I am not in the right Edit context.

Plugin Error: Cannot select node not in the current edit context: [object Object]

The question is.. how to get there? I do not want user to be selecting anything since I want to check whole document.
I also do not want to detach nodes from parents since the structure is already established.
Selection doesn't work and normally I would assume that this would be a way of getting to the right node....

Documentation doesn't explain how to change scope.

https://adobexdplatform.com/plugin-docs/reference/core/scenegraph.html
https://adobexdplatform.com/plugin-docs/reference/core/edit-context.html

418
Translate
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 Employee ,
Dec 03, 2018 Dec 03, 2018
LATEST

Hi EdenWS,

Please post your question here https://forums.adobexdplatform.com/top/all

Thanks,

Preran

Translate
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