|
How about an AppleScript?
Hello Everyone! This is my first post...caught the story in American Printer today.
I wrote this script to work with InDesign. Are we allowed to post Scripts? The way I do it is I create the ticket as an EPS in illustrator and then place it accordingly in an InDesign file. Then I create the text boxes for the raffle numbers and apply necessary styling. Doing this makes the only text boxes in the document, boxes for the raffle numbers. ID assigns a "number" to every text box you make, I still haven't figured out the order (across then down, or maybe vice-versa).
That probably didn't make much sense, but if you look at the code, you can see how it works. And it does work, beautifully. Number 00002 is under 00001 in the stack so that when you cut them, everything is in order.
Hope this works for you!
set myNumber to 0
on add_leading_zeros(this_number, max_leading_zeros)
set the threshold_number to (10 ^ max_leading_zeros) as integer
if this_number is less than the threshold_number then
set the leading_zeros to ""
set the digit_count to the length of ((this_number div 1) as string)
set the character_count to (max_leading_zeros + 1) - digit_count
repeat character_count times
set the leading_zeros to (the leading_zeros & "0") as string
end repeat
return (leading_zeros & (this_number as text)) as string
else
return this_number as text
end if
end add_leading_zeros
tell application "Adobe InDesign CS2"
activate
set myDocument to active document
--set the beginning number
set numBegin to 1
--set the end number
set numEnd to 150
--set the number of times the item is on the page
set numUp to 10
--set the number of leading zeros (i.e. setting to 5 will yield a 6 digit number)
set numZeros to 5
--calculate total sheets needed
set numPrint to ((numEnd - (numBegin - 1)) / numUp)
repeat with counter from 1 to numPrint
tell myDocument
repeat with subcounter from 1 to numUp
tell text frame subcounter of page 2
set contents to add_leading_zeros(((counter + numBegin - 1) + ((subcounter - 1) * numPrint)), numZeros) of me
end tell
end repeat
set subcounter to 1
print without print dialog
end tell
end repeat
end tell
|