Question from Novice user

I’m a begginer to Applescript.
I have to print a lot of PDF files in Adobe Acrobat and was getting tired of opening, printing, closing.
So, I found this Applescript to automate that. But here is my problem. With the following script, when it gets to print, it stops and I have to hit the return or enter key for the script to continue.

with timeout of 60 seconds – 1min to wait for response from user
tell application “Finder”
display dialog “ANY MESSAGE.” buttons {“Cancel”, “Ok”} default button 2
end tell
end timeout

set sourceFolder to (choose folder with prompt “Choose a folder with files to print:”) as text

tell application “Finder” to set workingFiles to (every file of folder sourceFolder) as alias list

repeat with workingFile in workingFiles
tell application “Adobe Acrobat Professional”
open workingFile
print workingFile
end tell
end repeat

I figured it was because I don’t have anything telling it to hit the Print Button after “print workingFile”
So I found the following that does just that. I want to add the ability for the script to click the Print button.

tell application “Adobe Acrobat Professional” to activate
tell application “System Events”
delay 0.2 – adjust delay as needed
key code 36 – enter or return
end tell

But when I combined them it doesn’t work. And if I remove
tell application “Adobe Acrobat Professional” to activate
tell application “System Events”
delay 0.2 and just leave key code 36, I get the following error:
“Syntax Error Expected end of line, etc. but found identifier.” No matter what I try I can’t get it work.
If I’m not mistaken the “key code 36” is the enter or return key. But apparently not for Adobe Acrobat. Any ideas would be appreciated. Thanks.

Try using the print pages command:

print pages active doc PS Level 3 with shrink to fit

Use the needed options from the dictionary:

Jerome, thanks a lot. That worked. The documents stay opened, what do I add to close the documents after printing?
Thanks again for your help.

Never mind. I got it.