• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Determining if a scripting addition is installed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Determining if a scripting addition is installed
      • From: kai <email@hidden>
References: 
 >Determining if a scripting addition is installed (From: Stephen Jonke <email@hidden>)
 >Re: Determining if a scripting addition is installed (From: Sander Tekelenburg <email@hidden>)

  • Prev by Date: Re: turn on Remote Apple Events remotely?
  • Next by Date: Re: Determining if a scripting addition is installed
  • Previous by thread: Re: Determining if a scripting addition is installed
  • Next by thread: Re: Determining if a scripting addition is installed
  • Index(es):
    • Date
    • Thread