1 person found this helpful
@Vamitul – it's all about the index order of your selection. That changed with InDesign CS5.5. In InDesign CS5.5 the index of selected objects is the order you made the selection. That is also true with InDesign CS6.
I know it's not very helpful to you since you rely on InDesign CS5.
That means you need a method to "tag" the right order of the text frames before threading them. A little bit cumbersome, though…
One method: would be to insert a unique label with the "insertLabel()" function, a string that represents a counting number. Every time you insert such a label to a single selected text frame you could insert a label with the actual number to the actual document and use that value for inserting the next label to the next single selection.
After that you could loop through the overall selection and thread the text frames together processing their labeled strings with the extractLabel() method.
Or: you use the geometric approach with your selected objects, going through their geometricBounds and looking for an geometric order you want to thread the frames.
Or: you're using Rorohikos' APID (Active Page Item Developer) with scripting. You should find the wanted functionality there:
With APID It should be possible to establish an "observer" that checks in what order you have selected your objects…
But ask Rorohiko first before buying ;-)
I'we taken a look at Rorohikos' APID, but i'm quite sure that my firm won't pay for it.
However the tagging ideea is actualy even better (for what i need to do). i have to define the order in witch the text needs to be exported (and maby even add a few bells with tagging for headings etc).
about the second script i was thinking if it was possible to create a startup script with a event listener for selection changes. The problem is... i'we never worked with event listeners before.