WhatTheyThink Acquires PrepressForums.com, Releases New Version of PrintPlanet

This site is a static archive, you are free to search, and view but no new posts or registrations are allowed.

Please visit printplanet.com for the new discussion groups

Prepress Forums  

Go Back   Prepress Forums
Googlemap ME Members List Calendar Search Today's Posts Mark Forums Read

» Site Navigation
 > FAQ
» Skyscraper

View Single Post
  #18 (permalink)  
Old 01-03-2007, 10:39 AM
pr0t0 pr0t0 is offline
Junior Member
 
Join Date: Jan 2007
Posts: 4
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
Reply With Quote
 

All times are GMT -8. The time now is 06:05 PM.


Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Powered by vBadvanced CMPS v3.0 RC1