You can use:
set myDocument to open inInputFile
display dialog "ERROR: can't open file."
1 person found this helpful
Sometimes you may want your script to proceed even if there are errors opening it. In that case, you can use the Preferences Suite -> Script Preference for user interaction level:
tell application "Adobe InDesign CS4"
tell script preferences
return user interaction level -- see what it's set to currently
--set user interaction level to never interact -- change it
Many thanks for your feedback. Setting the interaction level to "interact with alerts" was helpfull.