This content has been marked as final. Show 4 replies
Answer to Question 2:
You can't change the referencepoint of the textframe, you can only change the referencepoint of the document or application with layoutWindows.transformReferencePoint.
That leaves Question 1 still open
You're actually going along just fine. This is just one of ID's little inside jokes.
Changing the Reference point will not help you here; that's the point around which objects are rotated, the same as the transform proxy in the top left of your control panel.
What you want is to change the way the rulers are set up: not going all the way from the left page to the right, but starting over on each page. If you never seen that before, right-click the top ruler, and you will see that your current setting is "Ruler per Spread". Now, you can either change it to "Ruler per Page" in the interface, or -- the scripter's way of working --
the current setting (whatever it is), change it to 'per page', do your stuff, then change it back to its original value.
How about something like
oldViewPref = app.activeDocument.viewPreferences.rulerOrigin;
app.activeDocument.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
.. (your script here) ..
app.activeDocument.viewPreferences.rulerOrigin = oldViewPref;
Remove the line "myTextFrame.geometricBounds = ["2p","6p","20p","15p"];" and you'll see that the frames are placed on the correct pages. That means that you have your rulers set to "per spread", so that your geometricBounds always point to the same point on the spread.
Set your rulers to "per page" and the textframes will be placed on the correct page:
myDoc.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
[jong beat me to it!]
Thank you guys! Another puzzle solved :-)
I hope one day I can give an answer to a question i'm not asking myself