In the above question (opening a URL in a browser) - if the user
chooses FireFox and FireFox does not exist on that computer a
dialog is presented requesting the user 'Find' the application. I
want to suppress this dialog. Is this possible? Try-End Try doesn't
seem to work. Is there a more direct way to suppress ANY and ALL
errors.
The simplest way to solve this problem is using the open command line
tool, which can find applications by name.
This will work:
do shell script "open -a Finder " & quoted form of "/Users/Shared"
But this will fail with an error:
do shell script "open -a Fnider " & quoted form of "/Users/Shared"
If the error is displayed in a dialog, perform this inside a try, and
handle the specific error.
try
do shell script "open -a Fnider " & quoted form of "/Users/Shared"
on error message number errorNumber
-- Ignore expected error, fail on unexpected errors
if errorNumber is not 1 then error message number errorNumber
end try