Hello i’m currently writing a script to export PDF’s or EPS (depending on the RIP it going to) from Indesign CS5 with specific settings.
The user will input the page range he wants to export (in a dialog window), in the case of PDF when the user input will be (All), I want to create a PDF for each page separately and the name of these PDF will end by the page number in a 3 digits number. Same thing if he exports only one page, or pages here and there (ex. 26,52,53,96).
So my question is, is there a way to export separately when exporting more than one page or it has to be done with a repeat command?
For the naming of the files, can I get the page number that Indesign is currently exporting?
Thanks
I will probably have other questions later relating this thread.
Browser: Safari 534.57.2
Operating System: Mac OS X (10.7)
I’m just beginning, i write down on paper right now how I’m gonna build that cause is other stuff that comes with it. In applescript I juste did the beginning…
tell application "Adobe InDesign CS5"
set MyDocument to active document
set PDFPreset to "RampageCMYK" as string
set MyPDFexportPreset to PDF export preset PDFPreset
set MyPath to file path of MyDocument as string
set MyPages to text returned of (display dialog "Quelles pages voulez-vous exporter" default answer "All" as text)
set MyFolder to choose folder with prompt "Dossier de sauvegarde de vos fichiers:" default location alias MyPath
tell MyDocument
export format PDF type to (MyPath as string) & (name of MyDocument as string) & ".pdf" using MyPDFexportPreset without showing options
end tell
end tell
It’s ok if I want to export all the pages in the document, but if the user inputs (1,6,9,12) in the page range??? I have not enough experience in scripting to figure this thing out!
I figured it out but just in my head! I can’t write it down! here it is (I’ll need somebody to help me writing the right things…)
set MyPages to (display dialog "Quelles pages voulez-vous exporter" default answer "All")
The user will input (e.g. 4,6,7,11)
each numbers can be in a list in with each number is an item
then you make a repeat routine using each item in the list as reference to page numbers.
e.g.
repeat with ... in .... (actually not very good in repeats...)
tell PDF export preferences
set page range to (item in the list)
end tell
tell MyDocument
export format PDF type to (MyPath as string) & (name of MyDocument as string) & (Item in the list) & ".pdf" using MyPDFexportPreset without showing options
end tell
end repeat
end tell