Using Applescript to tell Acrobat Pro 9 to create and save a file
I have a script that will do the first two steps (i.e. open a specified pdf file and insert a range of pages into a new file) but I can't save the new file.
The save step should be trivial but the basic save command doesn't seem to work. Does anyone have a version that they have used that actually works? I am using Acrobat Pro 9 v9.3.2.
Here is my AppleScript:
set theFile1 to "xxx:sourcefile.pdf" -- the source file from which to extract pages
tell application "Adobe Acrobat Pro"
launch
activate
set doc1 to open theFile1
set mydoc to make new document -- this is where the extracted pages will go
insert pages mydoc after 1 from document 1 starting with <page number of first page to insert> number of pages <number of pages to insert> without insert bookmarks
delete pages mydoc first 1 last 1
-- using insert and delete because replace command gives error.
bring to front mydoc -- can see the new doc on the screen
save mydoc to "path:name.pdf" --- doesn't work!
end tell
MacBook Pro 2.66 Ghz Intel Core 2 Duo, Mac OS X (10.6.3)