Copy link to clipboard
Copied
Hello,
I am sure this is simple but I have been struggling with it all day.
I want to add a text frame to the top left of any page of my document.
Here is what I have done.
aPage = doc.pages[nn];
. . .
newTextFrame = aPage.textFrames.add( undefined, undefined, undefined, {geometricBounds:["0pt","0pt","100pt","100pt"] } );
I get a textframe on the left page. If the spread has two pages I get two textframes on page 1 of the spread.
Very grateful for any help.
Thanks.
P.
Hi,
guess it's cause of a Spread.origin. try:
currDoc = app.activeDocument;
currOrigin = currDoc.viewPreferences.rulerOrigin;
currDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
currDoc.pages.everyItem().textFrames.add( undefined, undefined, undefined, {geometricBounds:["0pt","0pt","100pt","100pt"] } );
currDoc.viewPreferences.rulerOrigin = currOrigin;
Copy link to clipboard
Copied
Hi,
guess it's cause of a Spread.origin. try:
currDoc = app.activeDocument;
currOrigin = currDoc.viewPreferences.rulerOrigin;
currDoc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
currDoc.pages.everyItem().textFrames.add( undefined, undefined, undefined, {geometricBounds:["0pt","0pt","100pt","100pt"] } );
currDoc.viewPreferences.rulerOrigin = currOrigin;
Copy link to clipboard
Copied
Thank you so much!
doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;
That did the trick.
P.