🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.scripting.indesign
Article #17959

(AS) Adding Text Frames to a page in InDesign

#17959
From: John Darnell
Date: Wed, 30 Apr 2003 20:40
47 lines
2537 bytes
Hello Fellow Scripters:

I am attempting to use this code to add text frames to the last page in the document:

---start code
on MakeTextBox(BoxNumber, TopCoord, LeftCoord, RightCoord, BottomCoord)
	local PageCount

tell application "InDesign 2.0.1"



set CurDoc to active document
tell CurDoc
activate
tell last page

--This publishes the expected pageids.		
display dialog "Using LAST page, this is the pageid: " & id

set CurrentFrame to make text frame
set MyFrameProperties to properties of CurrentFrame

tell CurrentFrame to move by {1, 1}
set properties of CurrentFrame to to {geometric bounds:{TopCoord, LeftCoord, BottomCoord, RightCoord}, label:BoxNumber}

--This publishes the expected page ids.
display dialog "This is the pageid after properties set: " & id

end tell			
end tell
end tell

end MakeTextBox
---end code

The "Display Dialog" lines are for debugging purposes as this is called from another library (I am using Script Debugger).

The workflow looks like this: create a page, place several text frames on it, fill the frames with text, move on to the next page and do it all over again.

The document is created in the script, and I set two pages per spread.

An earlier suggestion was to create the frame without any properties, move the frame a bit (the suggestion was implemented and is still in the code) and *then* set the properties.

By careful use of "display dialog" commands I have determined that the frames are being created on the correct page (verified by visual inspection), but when I set properties, regardless of the page *or spread*, all text frames get moved to the first page.

I realize that I am probably doing something stupid, but I am too ignorant to know what it is. Please folks, this is a show-stopper. Can I please get some help?
Technical Details
Message-ID: <1de8f1b6.-1@WebX.la2eafNXanI>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f939a,3219ea3e06fa079b,start
X-Google-Attributes: gidf939a,public
X-Google-ArrivalTime: 2003-04-30 14:08:02 PST
From: "John Darnell" <John.Darnell@Walsworth.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!news-out.visi.com!petbe.visi.com!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX
Newsgroups: adobe.scripting.indesign
Subject: (AS) Adding Text Frames to a page in InDesign
Message-ID: <1de8f1b6.-1@WebX.la2eafNXanI>
Date: Wed, 30 Apr 2003 13:40:30 -0700
Lines: 58
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit