Re: referring to global windows
Re: referring to global windows
- Subject: Re: referring to global windows
- From: Matthias Fripp <email@hidden>
- Date: Mon, 13 May 2002 23:16:00 -0700
Thanks everyone.
Brendan Younger's AppleScript works at least to get names of windows in
most OS X apps. I tried it with Mail, Finder, MS Word, etc. MS Word
returns a single window item instead of a list if it has only one window
open, but that's easy to work around. I tried briefly and without much
luck to find an AppleScript method to poll through all open
applications, but couldn't think of a way to actually enumerate all the
open applications. At any rate, AppleScript will only work with
applications that are ready for it, and I expect I'll also have trouble
figuring out the z order of the windows in AppleScript (I'd like my list
to go from top to bottom in the Window Manager's layering order). So I'm
putting AppleScript on hold for now.
As a few people have noted, Cocoa seems to have no public API for
accessing WindowServer information (or any undocumented one that I could
find). This is too bad, because it would make a lot of things really
easy if it existed. Replacing frameworks in all my Cocoa applications
seems like a "bigger hammer" than I need for this job.
Now I'm trying to see what I can find out about the Carbon functions
GetWindow() and GetNextWindow(), which look like they might offer a way
to shuffle through all open windows. It would be too bad if I have to
work in Carbon to make the most of OS X.
Thanks again.
Matthias
On Monday, May 13, 2002, at 06:39 PM, Ondra Cada wrote:
On Monday, May 13, 2002, at 08:54 , Matthias Fripp wrote:
So does this mean there is no way to get titles of windows or activate
them if they aren't owned by your own application?
No way *but* using the aforementioned loadable bundle. No way at all
(SO FAR AS I KNOW!!!) for Carbon.
Also there might be some AppleScript trick to do that -- I'm no
AppleScript expert.
On Sunday, May 12, 2002, at 03:43 PM, Ondra Cada wrote:
On Sunday, May 12, 2002, at 11:36 , Matthias Fripp wrote:
But this doesn't work for windows that are owned by any other
applications
Naturally. Those objects are in different address space, utterly
inaccessible to you.
If you wanna do such tricks, add your own bundle to each application
(see Mike Ferris' TextExtras source as for howto), and perform the
appropriate tasks inside of the application. From outside, you can't
do anything of interest.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.