As far as i know, menu bar extras (like Volume, Date & Time, Time Machine, etc.) are plug-ins of the SystemUIServer...
I can poll for open applications with something like the following
Now i have the identifier of the Volume menu bar extra:
I guess i could poll to see if the SystemUIServer is active because it shows up in Activity Monitor, but how can i go one level down and ask the SystemUIServer to list it's active Plug-Ins (menu bar extras)?
Is it even possible? I guess it has to be possible since they accept mouse events for removing and reorganizing, so they must be programatically accessible...
I can poll for open applications with something like the following
Code:
//Poll Processes
NSWorkspace *ws = [NSWorkspace sharedWorkspace];
NSArray *runningAppDictionaries = [ws launchedApplications];
NSDictionary *aDictionary;
for (aDictionary in runningAppDictionaries)
{
if ([[aDictionary valueForKey:@"NSApplicationBundleIdentifier"]
isEqualToString:@"com.apple.TextEdit"])
{
NSLog(@"TextEdit Is Active");
return;
break;
}
}
NSLog(@"TextEdit Is Not Active");
Now i have the identifier of the Volume menu bar extra:
Code:
com.apple.menuextra.volume
I guess i could poll to see if the SystemUIServer is active because it shows up in Activity Monitor, but how can i go one level down and ask the SystemUIServer to list it's active Plug-Ins (menu bar extras)?
Is it even possible? I guess it has to be possible since they accept mouse events for removing and reorganizing, so they must be programatically accessible...