Re: Definitive tell app as variable - not definitive after all
Re: Definitive tell app as variable - not definitive after all
- Subject: Re: Definitive tell app as variable - not definitive after all
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 12 Mar 2001 08:16:41 -0800
On 3/11/01 11:49 PM, I wrote:
>
I have long espoused Emmanuel Levy's version of the "tell app as variable"
>
because it was that little bit simpler than John Delacour's version, not
>
needing the <<class psn >> business. No one had ever found a flaw in it. But I
>
have just found it to fail, admittedly in special circumstances involving a
>
sort of bug in certain other applications. Nevertheless, under these special
>
circumstances, JD's version came through to save the day.
<snip>
>
But, I've just discovered that it does NOT work with Emmanuel's version:
>
>
>
set creaType to "MSNM"
>
tell application "Finder"
>
set appName to name of application file id creaType
>
if {appName} is not in (name of every process) then
>
open application file id creaType
>
end if
>
end tell
>
>
tell application appName
>
get <<class dfAc>> of application appName
>
end tell
>
-->ERROR: Can't get default mail account of application "Outlook Express"
>
>
No amount of (contents of) or (get) helps here. JD's version wins.
>
>
Except I hadn't tried everything . I hadn't tried 'its':
tell application appName
get its <<class dfAc>>
end tell
--> <<class popA>> id 1 of application "Outlook Express"
My abject apologies to Emmanuel, and to everyone for making a fuss about
nothing. The 'app name as variable' technique still works just as well as
'app as variable as <<class psn >> ' technique, even with these problematic
application properties. (The latter also works with 'its' instead of 'of
appVariable').
No winner . 'app name as variable' works just fine. I should have tried
'its' to begin with.
--
Paul Berkowitz