Here it is:
-(BOOL)isRunning:(NSString *)programBundleId {
return [[[NSWorkspace sharedWorkspace]
valueForKeyPath:@"launchedApplications.NSApplicationBundleIdentifier"]
containsObject:programBundleId] ? YES : NO;
}
The method returns YES if an application is running - in my case, it was useful to check if iTunes is running or not.