My script works fine on PDFs that have not been enabled for markup by acrobat reader. How do I get the script to continue once it encounters an ad already enabled? Thanks for all the help in advance.
set the_container to choose folder
if (count of items in the_container) is greater than 1 then
tell me to activate
end if
tell application “Finder”
try
set fileNameList to (every file in entire contents of the_container whose name ends with “.pdf”) as alias list
on error
set fileNameList to (every file in entire contents of the_container whose name ends with “.pdf”) as alias as list
end try
end tell
tell application “Adobe Acrobat Professional”
activate
tell application "Adobe Acrobat Professional"
repeat with iFile from 1 to count fileNameList
set thisFilePath to item iFile of fileNameList
set thisFilePath to thisFilePath as string
open file thisFilePath
tell application "System Events"
tell process "Acrobat"
delay 0.25
click menu item "Enable Usage Rights in Adobe Reader..." of menu 1 of menu bar item "Advanced" of menu bar 1
delay 0.25
keystroke return
delay 0.25
keystroke return
delay 0.5
tell window 1
repeat until exists button "Replace" of sheet 1
delay 0.25
end repeat
click button "Replace" of sheet 1
tell application "Adobe Acrobat Professional"
close last document
end tell
end tell
end tell
end tell
end repeat
end tell
end tell