• 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
Re: Finding front most window of a document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding front most window of a document


  • Subject: Re: Finding front most window of a document
  • From: glenn andreas <email@hidden>
  • Date: Tue, 23 Dec 2008 13:03:39 -0600


On Dec 23, 2008, at 12:55 PM, John Nairn wrote:

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)


NSWindowList
Gets information about onscreen windows.


void NSWindowList ( NSInteger size, NSInteger list[] );

Discussion
Provides an ordered list of all onscreen windows. It fills list with up to size window numbers; the order of windows in the array is the same as their order in the window server’s screen list (their front-to- back order on the screen). Use the count obtained by NSCountWindows to specify the size of the array for this function.





Glenn Andreas email@hidden <http://www.gandreas.com/> wicked fun! m.o.t.e.s. | minute object twisted environment simulation



_______________________________________________

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


References: 
 >Finding front most window of a document (From: John Nairn <email@hidden>)

  • Prev by Date: NSCoding, objects that can
  • Next by Date: copy object in kCFAllocatorMallocZone to scanned zone?
  • Previous by thread: Finding front most window of a document
  • Next by thread: copy object in kCFAllocatorMallocZone to scanned zone?
  • Index(es):
    • Date
    • Thread