+- (void)didSwitchApplication:(NSNotification *)notification {
+ NSRunningApplication *currentApp = notification.userInfo[NSWorkspaceApplicationKey];
+ ProcessSerialNumber psn;
+ OSStatus err;
+ if ((err = GetProcessForPID(currentApp.processIdentifier, &psn)) == noErr) {
+ [self->configsController applicationSwitchedTo:currentApp.localizedName withPsn:psn];
+ } else {
+ NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:err userInfo:nil];
+ NSLog(@"Error getting PSN for %@: %@", currentApp.localizedName, error);
+ }
+}