I am on InDesign 2023. VisualStudioCode.
I have a group of nested textFrames. I track the textFrames by their id. Now i need to duplicate these groups but still keep track of the textFrame duplicates.
Example: Let's say i have a group of pageItems (can be deeply nested and/or anchored):
- Rectangle with id 1
- TextFrame with id 2
- TextFrame with id 3
- (and many more)
I need to insert text in TextFrame with id 2. No problem by getting it by id.
Now i need to duplicate the wrapping group to a new location. No Problem too. On duplicating, the id of the textFrame inside the group changes and i obviously loose my reference of it.
So what i do is to use the label of the textFrame to store the id as string and recursively look for that in the duplicated group. This way i can identify the duplicated textFrame and continue using it, but is very slow for large groups and tons of duplicates.
So i was wondering if there's a more efficient way of accomplishing this task to keep a reference of a nested page Item in a group while duplicating it.
Any help appreciated.
Via Active questions tagged javascript - Stack Overflow https://ift.tt/UVk9zZ7
Comments
Post a Comment