I want to open PDFs and save them as HTML using Applescript.
It works in Acrobat 9 except I occasionally get random errors for no obvious reason.
The same code in Acrobat X doesn’t work and I can’t find the new syntax if it exists.
Here’s what works in 9 (sometimes)…
tell application “Adobe Acrobat Pro”
open file (defaultFolder & “:Source.pdf”)
save front document to file (defaultFolder & “:Temp.html”) using conversion “com.adobe.acrobat.html-3-20”
save front document to file (defaultFolder & “:Temp.txt”) using conversion “com.adobe.acrobat.plain-text”
close front document saving no
end tell
The text conversion works in X but the HTML conversion generates an error.
It returns “document 1 doesn’t understand the save message.”
Alternatively, is there a better way to do this. A command line tool to convert PDF to HTML would be great!
Thanks.
Model: MacBookPro 15" i7
AppleScript: 2.2.1
Browser: Safari 536.10
Operating System: Mac OS X (10.7)