In article ,
isw wrote:
> How can I find out what name to use in an AppleScript to address a
> particular window?
Something like this:
get name of every window
(Assuming you really want to target by name. May be fine for your own
personal use, but for scripts that you mean to distribute it may not
(the window might be named differently in other localisations, for
instance). Targeting by id is probably a safer bet.)
> I have a two-screen setup -- Macbook plus an external monitor. After
> I've used the MacBook stand-alone, I run an AppleScript that rearranges
> the windows across the two screens, but there are a couple of windows I
> haven't been able to "get ahold of".
>
> One is Mail's "Activity Viewer" window (AppleScript does not acknowledge
> that as its name, although that's what it says across the top); the
> other is iTunes when it is in the small "control panel" configuration.
> When it's in the "big window" configuration, my script moves it just
> fine, but not when it's small (so I suppose it has a different name
> then?)
This works fine for me, no matter whether the "iTunes" window is set to
full or small:
tell application "iTunes" to set position of window "iTunes" to {100,
100}
[iTunes 7.6.2 under 10.4.11, single screen]
> So I was wondering, is there some simple AppleScript I could run that
> would list *all* visible windows and their names?
It all depends on the app in question; what it makes available for
scripting. (I don't use Mail.app so I've no idea.)
File a bug report with the app's developer if you feel something that
isn't scriptable should be. <http://bugreporter.apple.com/> in this case.
--
Sander Tekelenburg, <http://www.euronet.nl/~tekelenb/>
Mac user: "Macs only have 40 viruses, tops!"
PC user: "SEE! Not even the virus writers support Macs!"
>> Stay informed about: Discovering the name of a window