Hey Guys,
Ok here is my issue. I have to do several things to a document in indesign when I am finished. I have to save it as a PDF, make JPGs of the page/s and save it and close it. I have been spending HOURS trying to figure out this scripting thing. Here is what i have so far:
tellapplication "Adobe InDesign CS5.5"
setpropertiesofPDF export preferencestopropertiesofPDF export preset "[High Quality Print]"
settheFilepathtofile pathofactive document
tellactive document
exportformatPDF typetotheFilepathwithoutshowing options
endtell
--JPEG Preference Settings
setmyJPEG_PrefstoJPEG export preferences
tellmyJPEG_Prefs
setresolutionto 48
setJPEG Qualitytomaximum
setJPEG export rangetoexport range
setJPEG Rendering styletobaseline encoding
endtell
--save file
ifmodifiedofactive documentistruethen
tellactive documenttosave
endif
closeactive document
endtell
Problem is that I get an error when i run it:
Result:
error "Adobe InDesign CS5.5 got an error: Cannot save to the file “Desktop”, because it is already open." number 9491
In the "events window":
tellapplication "Adobe InDesign CS5.5"
setpropertiesofPDF export preferencestopropertiesofPDF export preset "[High Quality Print]"
getfile pathofactive document
--> file "Web Design 1:Users:scottmemberg:Desktop:"
exportactive documentformatPDF typetofile "Web Design 1:Users:scottmemberg:Desktop:" withoutshowing options
--> error "Cannot save to the file “Desktop”, because it is already open." number 9491
Where did I go wrong? Do i need an "if" statement some where? Please Help!