newbie needs help wiht repeat command

I have several documents I need to open and print. The problem I get is once all documents are printed and closed my script errors out any ideas?

Thank you,

Jason


select PDF_Li
open selection
end tell
tell application "Acrobat 5.0"
repeat until PDF_L = 0
if PDF_Li = 0 then end
print pages
close document
end repeat

Look for the current thread on printing PDFs and let us know if your question was answered or if you need more help.

It sounds like a timeout error. AppleScript starts to worry if an application to which it’s given an instruction hasn’t reported back within a certain amount of time. (30, 60 seconds?)

Decide what’s a reasonable amount of time for your task to complete and use that as the parameter of a ‘with timeout’ block.

with timeout of 3600 seconds
  tell application "Acrobat 5.0"
  
    -- Do something that takes up to an hour
    
  end tell
end timeout