I am combining two applescripts in Automator. The first script does two tasks by using the “Batch Processing…” feature in Adobe Acrobat 9 Pro.
-
Crop hi-res PDF files so the crop marks no longer show.
-
Turn new file into lo-res file for internet use.
The third task is to make the files “Enabled for Commenting”. Unfortunately, this cannot be done with the “Batch Processing…” feature. I have found this script that works fine as a stand alone but I need it to work without using a prompt.
set thePDFs to choose file with prompt "Select the PDF(s) to enable commenting on" with multiple selections allowed
repeat with aPDF in thePDFs
tell application "Adobe Acrobat Pro"
open aPDF
end tell
activate application "Adobe Acrobat Pro"
tell application "System Events"
tell process "Acrobat"
click menu item "Enable for Commenting and Analysis in Adobe Reader..." of menu 1 of menu bar item "Comments" of menu bar 1
click button "Save" of window "Save As"
if exists sheet 1 of window "Save As" then
click button "Replace" of sheet 1 of window "Save As"
end if
end tell
end tell
tell application "Adobe Acrobat Pro"
close every document
end tell
end repeat
Here’s where I am currently at with a version that doesn’t use a prompt.
tell application "Finder"
set myFolder to "Users:jross:Desktop:Enable:Crop"
set thePDFs to select every file of myFolder
end tell
repeat with aPDF in thePDFs
tell application "Adobe Acrobat Pro"
open aPDF
end tell
activate application "Adobe Acrobat Pro"
tell application "System Events"
tell process "Acrobat"
delay 10
click menu item "Enable for Commenting and Analysis in Adobe Reader..." of menu 1 of menu bar item "Comments" of menu bar 1
click button "Save" of window "Save As"
if exists sheet 1 of window "Save As" then
click button "Replace" of sheet 1 of window "Save As"
end if
end tell
end tell
tell application "Adobe Acrobat Pro"
close every document
end tell
end repeat
I get an error:
error “Can’t get every file of "Users:jross:Desktop:Enable:Crop".” number -1728 from every file of “Users:jross:Desktop:Enable:Crop”
Seems that I am having trouble selecting multiple files from a certain location (folder). Any ideas on getting this applescript to work without using a prompt?