Re: AppleScript-Users Digest, Vol 3, Issue 652
Re: AppleScript-Users Digest, Vol 3, Issue 652
- Subject: Re: AppleScript-Users Digest, Vol 3, Issue 652
- From: Nir Soffer <email@hidden>
- Date: Mon, 1 Jan 2007 01:47:17 +0200
On Dec 28, 2006, at 21:43, Craig Hoyt wrote:
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
Best Regards,
Nir Soffer
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden