Re: Determining if a scripting addition is installed
Re: Determining if a scripting addition is installed
- Subject: Re: Determining if a scripting addition is installed
- From: Daniel Jalkut <email@hidden>
- Date: Fri, 2 Sep 2005 12:37:35 -0400
Does that work? Assume I have a scripting addition on my machine
that supports a command "sneeze loudly"... if I save this script:
try
sneeze loudly
on error
display dialog "Ahchoo!"
end
And mail it to you, then does it display a dialog "Ahchoo!" or just
fail to run? I can't compile the above script on my machine, because
I don't have the sneeze loudly scripting addition.
I assume there will be a script error if terminology from a missing
scripting addition is used. I think I have to log out to get any of
my additions to stop working, so I can't easily test right now.
Daniel
On Sep 2, 2005, at 9:58 AM, Sander Tekelenburg wrote:
At 09:22 -0400 UTC, on 2005/09/02, Stephen Jonke wrote:
Is there any way in applescript to determine if a particular
scripting addition is loaded? Or more specifically if a particular
command exists? I'd like to make my script use a scripting addition
if it is available, but if it isn't then use a workaround.
Sure, just use a try block:
try
-- routine that requires third-party SA
on error
-- routine that doesn't require it
end
If you can be sure what error number this would generate, you could
make it
more specific:
property ErrNum : <error number>
try
-- do stuff that requires third-party SA
on error number ErrNum
-- use routine that doesn't require it
end
thus allowing you to still also catch other specific errors.
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (Applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
40red-sweater.com
This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden