• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Finding front most window of a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Finding front most window of a document


  • Subject: Finding front most window of a document
  • From: John Nairn <email@hidden>
  • Date: Tue, 23 Dec 2008 10:55:51 -0800

I can't figure out how to determine the front most window of a document when the neither the document nor the application may be active. The application is when contacting an application from an Apple script. Here is what I tried:

[NSApplication keyWindow] and mainWindow become null when application or document are not main

[NSApplication windows] has list of all windows, but appears to be arbitrary order (or at least switching order of two windows does not change order in the windows array returned by NSApplication). Thus it cannot be used to find which window for a document is first.

I looked for some ordered list of windows but couldn't find it (although Apple Script "windows" property of an application does have them in order)

I looked for way to compare two windows to see which is in front of the other, but could not find one.

---------------
John Nairn
GEDitCOM - Genealogy Software for the Macintosh
http://www.geditcom.com


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Finding front most window of a document
      • From: glenn andreas <email@hidden>
  • Prev by Date: Re: NSCoding, objects that can
  • Next by Date: NSCoding, objects that can
  • Previous by thread: NSCoding, objects that can
  • Next by thread: Re: Finding front most window of a document
  • Index(es):
    • Date
    • Thread