Can anyone help with an Acrobat 8 problem?

The enclosed script for Acrobat 8 worked fine in OS X 10.4. When I upgraded to 10.5 the script doesn’t work the same. It doesn’t seem to recognize the window 1 or the close command. Is there some form of script verbiage that has changed? 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.25
keystroke return
delay 0.5
tell window 1
repeat until exists button “Replace”
delay 0.25
end repeat
click button “Replace”
delay 0.5
tell application “Adobe Acrobat Professional”
close last document
end tell
end tell
end tell
end tell
end repeat
end tell
end tell

I am in 10.4 in Acrobat 8 and this didn’t work for me until I took one of the keystroke return lines out. It was automatically clicking “Cancel” instead of “Replace”. Could that be the problem you are having? May the script is going faster now for some reason, i.e. it was skipping over a return before when you ran it?

Just a thought…

The script stops at the cancel window. It’s almost as if it doesn’t recognize the command. I didn’t have this problem until I upgraded to OS X 10.5.