Stripped out older stuff. It's better now :)
[MenuTunes.git] / PreferencesController.m
index 3a9ecd3..0e8c372 100755 (executable)
 
 - (IBAction)apply:(id)sender
 {
-    ProcessSerialNumber psn;
     NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
     [defaults setObject:myItems forKey:@"menu"];
     
         [defaults setInteger:5 forKey:@"SongsInAdvance"];
     }
     
-    psn = [mt iTunesPSN];
-    if (!((psn.highLongOfPSN == kNoProcess) && (psn.lowLongOfPSN == 0))) {
-        [mt rebuildMenu];
+    {
+        NSArray *apps = [[NSWorkspace sharedWorkspace] launchedApplications];
+        int i;
+        
+        for (i = 0; i < [apps count]; i++) {
+            if ([[[apps objectAtIndex:i] objectForKey:@"NSApplicationName"]
+                    isEqualToString:@"iTunes"]) {
+                [mt rebuildMenu];
+            }
+        }
     }
     [mt clearHotKeys];
 }