Article View: adobe.scripting.indesign
Article #19166tell text frame "Label" of page not possible - (AS)
From: Armin.Egginger
Date: Tue, 14 Jan 2003 19:44
Date: Tue, 14 Jan 2003 19:44
79 lines
4067 bytes
4067 bytes
Hi,
I have a new problem by scripting the text frame, which is placed in the master spread. I want to change the content from this text frame per page. To tell the text frame per page and set the content is not possible. The contents depense on the page-content (example: address from "A - C", next page is: address from "D - F",...). I count the textframe per page and the result is very interesting - ID only counts the text frames which are placed directly in the spread, It doesn't count the text frames which are placed in the master spread, but I want to place some informations in this frames - how does this function?
--My Script
--Handler
on setnewframe(y, x, h, w, c, thelabel, myDocument)
tell application "InDesign 2.0.2"
tell master spread 1 of myDocument
repeat with p from 1 to (count every page of master spread)
tell page p
set thenewframe to make text frame with properties {geometric bounds:{y, (210 - (w + x)), (h + y), (210 - x)}, contents:c, label:thelabel}
tell text of thenewframe to set justification to right
end tell
end repeat
end tell
end tell
end setnewframe
--Script
tell application "InDesign 2.0.2"
set theMarginPrefs to margin preferences
tell theMarginPrefs
set column count to 1
set column gutter to 10
set margin top to 15
set margin bottom to 10
set margin left to 7
set margin right to 7
end tell
set myDocument to make document
tell myDocument
set theViewPreferences to view preferences
tell theViewPreferences
set horizontal measurement units to millimeters
set vertical measurement units to millimeters
end tell
set theDocPrefs to document preferences
tell theDocPrefs
set pages per document to 1
set page orientation to landscape
set page height to 297
set page width to 210
end tell
end tell
set ruler origin of view preferences of myDocument to page origin
set myMarginPreferences to margin preferences
repeat with i from 1 to (count every page of myDocument)
tell page i of myDocument
set myTextFrame to make text frame with properties {geometric bounds:{margin top of myMarginPreferences, margin left of �
myMarginPreferences, 297 - (margin bottom of myMarginPreferences), �
210 - (margin right of myMarginPreferences)}}
end tell
end repeat
setnewframe(0, 10, 10, 35, "Headline", "TF1", myDocument) of me
setnewframe(7, 10, 10, 35, "text under headline", "TF2", myDocument) of me
setnewframe(290, 87, 5, 35, "page ^#", "PF1", myDocument) of me
end tell
(*if I ask how many text frames are on the page - the result is only 1
they don't count the textframes from the masterspread - so I can't tell the text frames directly to
set the contents to another informations*)
tell myDocument
repeat with i from 1 to (count every page)
repeat with n from 1 to (count every text frame)
get properties of text frame n
--I want to -- set the content of text frame "TF1" to "some text informations"
--I want to -- set the content of text frame "TF2" to "more text informations"
--I want to -- set the content of text frame "PF1" to "some text"
end repeat
end repeat
end tell
I hope this helps to show you what I want to do.
Many thanks
Armin
The ID-scripting beginner
Technical Details
Message-ID:
<1de760bc.-1@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebXShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,9453c504c7e28b9b,start X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-01-14 12:07:58 PST From: Armin.Egginger <armin.egginger@gmx.de> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!fr.clara.net!heighliner.fr.clara.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: tell text frame "Label" of page not possible - (AS) Message-ID: <1de760bc.-1@WebX.la2eafNXanI> Date: Tue, 14 Jan 2003 11:44:56 -0800 Lines: 94 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit