Re: OSAX within tells
Re: OSAX within tells
- Subject: Re: OSAX within tells
- From: Emmanuel <email@hidden>
- Date: Thu, 18 Jan 2001 23:46:16 +0100
At 22:15 +0100 18/01/01, Cal wrote:
>
email@hidden writes:
>
>
>>>>>And, it is not necessary - and may sometimes be a bad idea - to
>
>>>>>>>encapsulate
>
>a call to a Scripting Addition in a "tell" wrapper.
(that was me initially)
>
>IMHO it's a worse idea to try to write scripts with Osax calls outside of
>
>tell blocks.
>
>
>
> [...] it clutters up and breaks up perfectly readable and understandable
>
>AppleScripts for no good reason.
(that was Ed)
>
Placing osax commands inside tell blocks has certain effects, some of
>
which may not be desirable:
>
>
[...]
>
>
So I'd give the following advice: Be cautious of calling scripting
>
additions in tell blocks, unless [...]
In specific cases though you may want to send the osax command to an app.
If your script is running from a given application, you may want to use the
other apps as your slaves (oops, servers): you send them heavy osax
commands, which may freeze them, say, for minutes, while the front app
remains responsive.
Of course the calling script will not get the returned result, you would
have to cope with that.
-------------------- tested
ignoring application responses
tell application "Finder" to RA connect
end ignoring
--------------------
If you love risk, you may even send the command to hidden apps:
-------------------- untested (should crash)
tell application "FaxMonitor" to RA connect
--------------------
Emmanuel