1

I am trying to retrieve all applications which are enlisted in force quit window.

When I am using runningAppications method using below line of code:

[[NSWorkspace sharedWorkspace] runningApplications];

It is enlisting many extra applications which are not enlisted in force quit window.

Can any one suggest me some way to achieve it?

Devarshi
  • 16,440
  • 13
  • 72
  • 125
  • Inspect the array/list of runningApplications. There must be some similarity between the applications those are listed in Force Quit list. You can add a watch to the variable in XCode and add a break point then inspect... – Imdad Jul 20 '12 at 08:56

1 Answers1

2

The following array contains the applications listed in the "Force Quit Applications" window:

NSArray *apps = [[NSWorkspace sharedWorkspace] valueForKeyPath:@"launchedApplications.NSApplicationName"];
Anne
  • 26,765
  • 9
  • 65
  • 71
  • hi, thanks for your help :-) .. it is working as I expect but it seems to be deprecated in OS X 10.7.. any other alternative solution? – Devarshi Jul 06 '12 at 06:58
  • As far I'm aware the code above is not deprecated, using the 10.7 deployment target I don't get any warning. – Anne Jul 06 '12 at 07:03