I needed a way to terminate an application from within another without using Apple Script or old Carbon stuff. I finally found this nifty solution: if ([[NSWorkspace sharedWorkspace] respondsToSelector:@selector(runningApplications)]) {
for (NSRunningApplication *app in [[NSWorkspace sharedWorkspace] runningApplications])
if ([@"Suggestions" isEqualToString:[app localizedName]])
[app terminate];
}
Daily Snippet
-
edinburgh78rop liked this
-
nesmithwc86 liked this
-
woundedopt6 liked this
-
keynotetis8 liked this
-
katherineok56 liked this
-
justinherrick liked this
-
moapp posted this