set the_file to "MacOSX:Users:matmac:Desktop:Sample.pdf"
tell application "Adobe Acrobat Pro"
activate
open the_file
set New_File_Path to "MacOSX:Users:matmac:Desktop:Sample.rtf"
save front document to file New_File_Path using conversion "com.adobe.acrobat.rtf"
close front document
end tell
Here is the repiles from the script:
tell application “Adobe Acrobat Pro”
activate
open “MacOSX:Users:matmac:Desktop:Sample.pdf”
→ missing value
→ error number 0
save document 1 to file “MacOSX:Users:matmac:Desktop:Sample.rtf” using conversion “com.adobe.acrobat.rtf”
close document 1
end tell
I don’t understand the “–> missing value” and “–> error number 0” replies. As the pdf opens without error into Acrobat and closes without error as well.
Are the ‘save’ and ‘using conversion’ syntax correct for Adobe Acrobat X (v10.1.3)?
tell application "System Events"
tell application process "Acrobat"
tell application "Adobe Acrobat Pro" to activate
click the menu item "Save as Rich text" of menu 1 of menu item "Action Wizard" of the menu "File" of menu bar 1
delay 2
click button "Close" of window 1
end tell
end tell
Created an Action in Acrobat to ‘Save as Rich text’. Called the Action using GUI scripting. Not elegant but works.
Maybe Stefan is busy, but you might try changing the line to:
set the_file to file "MacOSX:Users:matmac:Desktop:Sample.pdf"
This is a file specification (a reference to a file that does not exist yet. As it where, you just had the string “MacOSX:Users:matmac:Desktop:Sample.pdf”. I don’t have Acrobat pro so can’t test it.
Looking at it again, you’re opening the pdf which might need a reference. Instead use alias instead of file although you should be able to use file also. But, in this line:
set New_File_Path to "MacOSX:Users:matmac:Desktop:Sample.rtf"
You might want to use the file specification:
set New_File_Path to file "MacOSX:Users:matmac:Desktop:Sample.rtf"
Also, you might want to do this out of the tell block if it doesn’t work in it.
I think what Kel meant to suggest was to try using a file specifier with the ‘open’ command ” as you do with the ‘save’ command ” to see if that gets rid of the unexplained replies.
set the_file to "MacOSX:Users:matmac:Desktop:Sample.pdf"
tell application "Adobe Acrobat Pro"
activate
open file the_file -- NB. file specifier, not just an HFS path.
set New_File_Path to "MacOSX:Users:matmac:Desktop:Sample.rtf"
save front document to file New_File_Path using conversion "com.adobe.acrobat.rtf"
close front document
end tell
I don’t have Acrobat Pro, so I’m afraid don’t know why no new file’s produced. I presume the document was opening in the first place.