• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

New textframe on any page

Guide ,
Dec 09, 2012 Dec 09, 2012

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.

TOPICS
Scripting

Views

538

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Dec 09, 2012 Dec 09, 2012

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;

Votes

Translate

Translate
Enthusiast ,
Dec 09, 2012 Dec 09, 2012

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;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Dec 09, 2012 Dec 09, 2012

Copy link to clipboard

Copied

LATEST

Thank you so much!

doc.viewPreferences.rulerOrigin = RulerOrigin.PAGE_ORIGIN;

That did the trick.

P.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines