Copy link to clipboard
Copied
Hi All,
I need help to select parent grouped item by selecting a text frame within group item. Here is what I am trying.
1. Searching a Paragraph style using script (note this paragraph style always available within grouped item)
2. Selecting searched text
3. using .parent code to go to grouped item
Problem is when I am targeting .parent item it's going to document instead of group item. Please help me to resolve this issue.
Thanks,
Shonky
Hi,
It all depends on the way you're targeting a parent:
text.parent(Story).parent ==> Document
text.parentTextFrames[0](textFrame).parent ==> could be a Group if grouped.
Jarek
Copy link to clipboard
Copied
Hi All,
I need expert advice on above issue. It will appreciate if anyone help here.
Thanks,
Shonky
Copy link to clipboard
Copied
Hi,
It all depends on the way you're targeting a parent:
text.parent(Story).parent ==> Document
text.parentTextFrames[0](textFrame).parent ==> could be a Group if grouped.
Jarek
Copy link to clipboard
Copied
Be aware that text.parentTextFrames[0] will throw an error if text is hidden (overflowing).
Copy link to clipboard
Copied
Thanks Jerek, it worked!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now