I am new to scripting with Adobe and InDesign and perhaps it is my script that is not well thought but
below are some unexpected behaviors I have seen so far.
(This suppose an in design file which elements are related to an xml tree)
- duplicate groups:
when i duplicate a group containing elements related to the xml, the related xml elements are added at the wrong place:
duplicating the group containing those elements will result in:
the prod tag is indeed not attached to anything but why place them here (i would find more logical to add them on the root)?
should i do this in an other way??
duplicate the prod in the xml tree and then add them on the page (is this possible ?)
attach the prod tag to a Story will solve this? (instead of copying the group, i'll copy a story containing the group?)
- remove xml element associated to an object on the page
works fine for Story :
it will remove the corresponding tag in the xml tree and live the pageItem on the page with the text
but with graphics,it will erase both of them (the xml tag and the graphic on the page)
i guess that the linkage is lost but i don't loose the text when removing text based item...
- reassigning geometricBounds to a group.
i duplicate each group and place them on the page one after an other.
if need so , i move them to a new page.
As i use the duplicate function (it seems that groups is equivalent to the last duplicated item, stack?),
i use the offset related to the last group duplicated.
when i move to the second page, obviously the offset is plaining wrong so I ve tried to reassign the geometricBounds of the very first group.
for some reason, it does place the group back at the same position but loose the graphic in the mean time...
i have changed it so that i calculate the proper offset when moving to a new page anyway, but still wondering why.
- loosing the appliedParagraphStyle with placeXML:
$.writeln(elm.parentStory.appliedParagraphStyle.name) ->displays the proper style
$.writeln(elm.parentStory.appliedParagraphStyle.name) ->displays the default style
That's all for now...
I have been doing this for only 2 days now so it is far to be 'in design' minded