Re: App switcher in OS 9
Re: App switcher in OS 9
- Subject: Re: App switcher in OS 9
- From: Sun Real <email@hidden>
- Date: Wed, 2 May 2001 09:03:10 +1000
Christopher Nebel's message of 1/5/01 4:29 AM contained:
>
...First off, things that work and things that don't:
>
>
tell application "Application Switcher"
>
get item 1 of position of palette -- no dice.
>
set x to position of palette
>
item 1 of x -- this works...
>
get item 1 of ((position of palette) as list) -- as does this...
>
get item 1 of (get position of palette) -- or this.
FWIW, here's another:
set {posX, posY} to position of palette
>
end
For those who aren't quite clear on what that's doing, I'm just counting
on the fact that I'm going to get a list containing 2 items so I declare
the expected structure explicitly.
It's just another way of doing it & could be looked upon as less than
ideal practice, in some situations at least. If the property changes at
some stage in the future that line will break.
Then again, it could also be argued that it might be better to break
there - right on the offending line, as it would - than later on when
your script is trying to do something with the bad data.
>
>
The problem has to do with how AppleScript sends "get data" commands to
>
applications and how applications handle them...
>
>
..if you try to ask
>
them for the sub-bit in one shot, it won't work -- AppleScript assumes
>
that the application will take care of everything, and it doesn't....
>
This is all rather counter-intuitive and irritating, of course, but
>
unfortunately, solving it is hard and would probably require cooperation
>
from applications. It's on my list, but a ways down.
I'm reminded again of how the value of this list has increased
dramatically since you've been posting regularly Chris. This, like most
if not all of your info, is invaluable for people like me.
I'm sure I would not be alone in this, but for myself I'd just like to
say, "Thanks!"
Cheers,
Richard Morton
-- Great Lies of the Music Business: "My last band had a record deal
but we broke up before we could record the album"