Article View: adobe.scripting.indesign
Article #17328Re: Numbering script?
From: Jay Fraser
Date: Wed, 18 Jun 2003 21:52
Date: Wed, 18 Jun 2003 21:52
78 lines
3092 bytes
3092 bytes
Dave:
3 part NCR usually comes pre-collated in a box: white-pink-green-white-pink-green, etc. So back in the days of numbering machines, you would hit the same number 3 pages in a row, then change, then 3 times the same, etc. I.e. 001, 001, 001, 002, 002, 002, etc.
At least, that's how we did it when I was a wee tot in the print shop. That was many beers ago.
Here's a script that does what I think Laura needs; it assumes:
� you can print 3 copies uncollated
� you have everything on the master page of a "non-facing page" document
� you have a single text frame labeled "SerialFrame Master" on the master document where the serial number is supposed to go.
� text in this frame is already formatted the way you want it. All text in this frame will be replaced by the serial number
tell application "InDesign 2.0.2"
set mySerial to ""
set myNumber to ""
set myDoc to active document
tell myDoc
repeat with i from 1 to count pages
tell page i
-- This finds the text box for the running head
try
set mySerialFrame to (text frame 1 whose label is "SerialFrame")
on error
-- releases the running head text box from the master pages if needed
try
set mySerialFrame to (master page item 1 whose label is "SerialFrameMaster")
on error
set dialogResult to display dialog "Can't find 'SerialFrameMaster'. " & return & return & �
"Please select text frame of serial number on master page and label it 'SerialFrameMaster'." buttons "Whoops" with icon 0
if button returned of dialogResult = "Whoops" then error number -128
end try
set label of mySerialFrame to "SerialFrame"
end try
-- creates number w/ lead zeros, then puts it in the box
set myNumber to "000" & i
set mySerial to characters -4 thru -1 of myNumber
set contents of mySerialFrame to mySerial as text
end tell
end repeat
end tell
end tell
Technical Details
Message-ID:
<1de99780.7@WebX.la2eafNXanI>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebXReferences:
<1de99780.-1@WebX.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f939a,6a892b1866938409 X-Google-Attributes: gidf939a,public X-Google-ArrivalTime: 2003-06-18 15:07:53 PST From: "Jay Fraser" <jayfraser@yahoo.com> Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.news2me.com!newsfeed.freenet.de!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!WebX Newsgroups: adobe.scripting.indesign Subject: Re: Numbering script? Message-ID: <1de99780.7@WebX.la2eafNXanI> Date: Wed, 18 Jun 2003 14:52:27 -0700 References: <1de99780.-1@WebX.la2eafNXanI> Lines: 60 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit