I am working on a script to save single .ps files out from a multi-page Indesign document. It will allow me to set the prefix of the document, allow me to mark it as a revision and uses a preset I have already created in my printer presets within InDesign.
All I need to figure out is the page range section, any help on that part would be great., (Assuming that the user could place a comma between pages and an “-” between a range of pages for example (1,3,5-8,10) would then print pages (1,3,5,6,7,8,10).
Also, right now I have it using a print preset I call “BANTA” that is hard coded into the applescript, is there a way to have a drop down menu on the initial dialog window, filled with choices that is information from the printer preset preferences set up on individual stations allowing the user to select from their own choices saved for that machine?
Also why we are at it, is there a way to create a browse location field/button from the first dialog winow instead of asking for it in a second window? I am justing of a way to simpify the steps and number of windows?
here is what I have to-date
tell application "InDesign CS"
set myDocument to active document
set myDocumentName to name of myDocument
set myDialog to make dialog with properties {name:"File Naming Options"}
tell myDialog
tell (make dialog column)
set myBorderPanel to make border panel
tell myBorderPanel
make static text with properties {static label:"Prefix Name:"}
set myBaseNameField to make text editbox with properties {edit contents:myDocumentName, min width:180}
end tell
set myBorderPanel to make border panel
tell myBorderPanel
make static text with properties {static label:"Page Range:"}
set myPageRangeField to make text editbox with properties {edit contents:"", min width:180}
--set myPageRangeField to make text editbox with properties {edit contents:myPageRange, min width:180}
end tell
set myBorderPanel to make border panel
tell myBorderPanel
make static text with properties {static label:"Revised Page:"}
set myRadioButtons to make radiobutton group
tell myRadioButtons
make radiobutton control with properties {static label:"Yes"}
make radiobutton control with properties {static label:"No", checked state:true}
end tell
end tell
end tell
end tell
set myResult to show myDialog
if myResult is true then
--The name of the exported files will be the base name + the value of the counter +".ps".
set myBaseName to edit contents of myBaseNameField
if selected button of myRadioButtons is 0 then
set myRevision to "-r"
else
set myRevision to ""
end if
set myPageRange to edit contents of myPageRangeField
--Remove the dialog box from memory.
destroy myDialog
set myPages to pages of myDocument
set myFolderPath to (choose folder with prompt "Please select the folder you want to save your Post Script Files in") as string
set mySeparator to "_"
set theProps to properties of printer preset "BANTA"
set properties of print preferences of myDocument to theProps
repeat with anItem in myPages
set myPageNumber to name of anItem as string
set MyFile to myFolderPath & myBaseName & mySeparator & myPageNumber & myRevision & ".ps"
set myPages to myPageNumber
tell myDocument
set page range of print preferences to myPageNumber
set print file of print preferences to MyFile
print without print dialog
end tell
end repeat
else
destroy myDialog
end if
end tell