Re: install & use scripting addition on fly
Re: install & use scripting addition on fly
- Subject: Re: install & use scripting addition on fly
- From: Christopher Nebel <email@hidden>
- Date: Wed, 7 May 2003 14:03:15 -0700
On Tuesday, May 6, 2003, at 03:06 PM, Jon Pugh wrote:
At 8:46 AM -0500 5/6/03, email@hidden wrote:
I have a script that checks for a scripting addition, then if not
available, it moves it into the scripting additions folder. I do this
with two different scripting additions that I use. Neither osax
requires a reboot.
However it seems that one of them will fail now and then. It's as
if it isn't quite ready yet? Is there a way I can call it or hit it
with the finder, try, open, ?? and snap it into being useable. Does
anyone have any ideas for that...
You need to get OSACompile or OSAExecute called. These are the
routines that check and reload the scripting additions folder.
In fact, those are merely the major entry points that cause the
business end of the process to be called. The actual scan-and-load
process is driven by a magic Apple event, which you can invoke as part
of your script. The incantation looks like this:
tell me to <<event ascrgdut>>
(Substituting real guillemots for the double angle brackets, of course.
Obligatory cursing of the mailing list software here.)
In classic Mac OS, it doesn't matter who the event is sent to, because
scripting additions live in a shared system space. In Mac OS X, each
application has its own view of the scripting additions world, so you
need to send it to the same one you're going to send the scripting
addition command to. This is often, but not always, yourself.
Jon's suggestion of calling 'run script "5"' will also work, but it's
sort of a side effect. JD's suggestion of using "using terms from"
might help you compile a script that used the troublesome additions,
but wouldn't help at run time, because the handlers wouldn't be
installed.
--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.