Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AppleScript-Users Digest, Vol 3, Issue 652




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:
http://lists.apple.com/mailman/options/applescript-users/email@hidden
Archives: http://lists.apple.com/mailman//archives/applescript-users

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.