I’m new at scripting indesign and i’m trying to create a script to export a document as PDF but… i’m stuck, i don’t know what i’m doing wrong… can anyone help me out.
tell application “Finder”
activate
set work_file to choose file with prompt “Choose the document.”
set dest_file to make new file at desktop with properties {name:“test.pdf”}
set alias_file to dest_file as alias
tell application “InDesign 2.0.2”
open work_file
set my_doc to active document
set theDocPath to full name of document 1
export my_doc format “eBook” to file alias_file
end tell
end tell
Um, no. There are a lot of things wrong with your code: there is no need to nest the tell statements for InDesign inside the Finder tell block; don’t tell the Finder to make a new file; you switch several times between references to document 1 in your InDesign code; and your basic syntax for the export is off. Try this code:
add a folder named “PDF Services” to ~/Library/ and on all print panels a little pdf icon gets added to all print dialogs. when you click it a pop up menu appears with a “save as pdf…” option. you can also add aliases of folders to the PDF Services folder and options will be added to the menu like “save as pdf to {folder name}”
not a script but it works with every app and you can just press command-p and a click