• 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: Second frontmost app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Second frontmost app?


  • Subject: Re: Second frontmost app?
  • From: Dave DeLong <email@hidden>
  • Date: Tue, 28 Apr 2009 11:02:52 -0600

Sounds good.

For documenting purposes, here's what I did to get this working:

In the appropriate class, I have an NSMutableArray called "activeApps" and a timer called "appTimer". The timer is scheduled to fire every 0.5 seconds. When it fires, it gets the activeApplication dictionary from NSWorkspace, and compares that to the 0th element in activeApps. If they're different, then the new dictionary is inserted at index 0, and the last element (if the count is greater than 2) is removed.

Whenever I need the second frontmost app, I just get the dictionary at index 1 in activeApps.

Dave

On Apr 28, 2009, at 10:57 AM, Jean-Daniel Dupas wrote:

Don't bother with that. I did a try, and it look like the Process Manager order has nothing to do with the cmd + tab order.
it returns -600, probably because psn is the last process in the Process Manager list.
Sorry for the noise.
_______________________________________________

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: 
 >Second frontmost app? (From: Dave DeLong <email@hidden>)
 >Re: Second frontmost app? (From: Jean-Daniel Dupas <email@hidden>)
 >Re: Second frontmost app? (From: Dave DeLong <email@hidden>)
 >Re: Second frontmost app? (From: Jean-Daniel Dupas <email@hidden>)

  • Prev by Date: Re: Why is NSString->FSRef so hard?
  • Next by Date: Re: Second frontmost app?
  • Previous by thread: Re: Second frontmost app?
  • Next by thread: Re: Second frontmost app?
  • Index(es):
    • Date
    • Thread