InDesign script Optimization and text frame threading
InDesign script Optimization and text frame threading
- Subject: InDesign script Optimization and text frame threading
- From: David Wolfe <email@hidden>
- Date: Mon, 13 Feb 2006 15:51:35 -0500
Hi All,
I am working on the InDesign CS script below and have two questions
for the group:
1) Is there a better way to iterate through the pages in the document
to make the script more streamlined and more flexible for different
document lengths?
2) How can I script the threading of each overridden text frame to
the one on the next (or previous) page? Once I get this far, I can't
seem to be able to set the properties {next text frame:Frame2} or
properties {previous text frame:Frame1}. I have tried both in the
override itself:
set Frame2 to (override selection destination page (item 2 of
myPages)) with properties {previous text frame:Frame1}
and with a separate command under the comment --Link (thread) photo
credit text frames together into one thread (or chain)
set Frame1 properties {next text frame:Frame2}
Neither seems to work.
Any help is really appreciated
David Wolfe
settingPace
-----The Script so
far---------------------------------------------------------------------
-----------------------------------------------
tell application "InDesign CS"
set mydocument to active document
set myPSName to "PC-Photo credit bl.il"
set protoType to "«fields page, placement, credits" & return & "«If
Page = pageinfo(3)»«If prev page = pageinfo(3)»,
«endif»«placement»«credits»«repeat 50»«if next page is not pageinfo
(3)»" & return & "«endif»«end repeat»«endif»"
-- Setting Ruler Origin and Zero Point
set theOrigin to ruler origin of view preferences of mydocument
if theOrigin is not page origin then
set ruler origin of view preferences of mydocument to page origin
end if
--Set Zero Point of Ruler to Zero
set theRuler to zero point of mydocument
if theRuler is not {0, 0} then
set zero point of mydocument to {0, 0}
end if
--choose working layer & Master Page
set active layer of active window to layer "credits for PDF product
only" of active document
set layerName to "credits for PDF product only"
set myMasterPages to get every page of master spread "F-Slug" of
active document
set myPages to get every page of every spread of active document
--make creditFrame text boxes
--first verso . . .
tell item 1 of myMasterPages
set myCreditFrameVerso to make new text frame with properties
{content type:text type, geometric bounds:{63.75, 3.0, 64.25,
44.625}, label:"masterpageFrameVerso"}
end tell
tell active document
set theStyle to paragraph style "PC-Photo credit bl.il"
set myStory to parent story of myCreditFrameVerso
set applied paragraph style of myStory to theStyle
end tell
--then recto . . .
tell item 2 of myMasterPages
set myCreditFrameRecto to make new text frame with properties
{content type:text type, geometric bounds:{63.75, 6.375, 64.25,
48.0}, label:"masterpageFrameRecto"}
end tell
tell active document
set theStyle2 to paragraph style "PC-Photo credit bl.il"
set myStory2 to parent story of myCreditFrameRecto
set applied paragraph style of myStory2 to theStyle2
end tell
--override master page text boxes
select myCreditFrameVerso
try
set Frame1 to (override selection destination page (item 1 of
myPages))
set Frame3 to (override selection destination page (item 3 of
myPages))
set Frame5 to (override selection destination page (item 5 of
myPages))
set Frame7 to (override selection destination page (item 7 of
myPages))
set Frame9 to (override selection destination page (item 9 of
myPages))
set Frame11 to (override selection destination page (item 11 of
myPages))
set Frame13 to (override selection destination page (item 13 of
myPages))
set Frame15 to (override selection destination page (item 15 of
myPages))
set Frame17 to (override selection destination page (item 17 of
myPages))
set Frame19 to (override selection destination page (item 19 of
myPages))
set Frame21 to (override selection destination page (item 21 of
myPages))
end try
try
select myCreditFrameRecto
set Frame2 to (override selection destination page (item 2 of
myPages))
set Frame4 to (override selection destination page (item 4 of
myPages))
set Frame6 to (override selection destination page (item 6 of
myPages))
set Frame8 to (override selection destination page (item 8 of
myPages))
set Frame10 to (override selection destination page (item 10 of
myPages))
set Frame12 to (override selection destination page (item 12 of
myPages))
set Frame14 to (override selection destination page (item 14 of
myPages))
set Frame16 to (override selection destination page (item 16 of
myPages))
set Frame18 to (override selection destination page (item 18 of
myPages))
set Frame20 to (override selection destination page (item 20 of
myPages))
set Frame22 to (override selection destination page (item 22 of
myPages))
end try
--Link (thread) photo credit text frames together into one thread
(or chain)
--make inData Prototype for on-page photo credits
set pageOne to page 1 of active document
tell pageOne
set myPrototype to make new text frame with properties {content
type:text type, geometric bounds:{75, 1.59, 79, 23}, contents:protoType}
set myProtoText to parent story of myPrototype
set applied paragraph style of myProtoText to theStyle
end tell
--begin import of Photo Credit Data
set myCredits to parent story of Frame1
import data from file (choose file) using prototype story
myProtoText into story myCredits with showing dialog
end tell
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden