Re: Determinating iChat status
Re: Determinating iChat status
- Subject: Re: Determinating iChat status
- From: Andreas Mayer <email@hidden>
- Date: Mon, 31 May 2004 14:47:41 +0200
Am 31.05.2004 um 10:33 schrieb Aidas Dailide:
I've tried to use AppleScript to do so, but unfortunately to make it
work iChat has to be opened.
You could check if iChat is running before you execute the script:
- (BOOL)appRunningWithBundleIdentifier:(NSString *)bundleIdentifier
{
BOOL result = NO;
NSArray *allApps = [[NSWorkspace sharedWorkspace]
launchedApplications];
NSEnumerator *enumerator = [allApps objectEnumerator];
NSDictionary *app;
while (app = [enumerator nextObject]) {
if ([[app objectForKey:@"NSApplicationBundleIdentifier"]
isEqualToString:bundleIdentifier])
{
result = YES;
break;
}
}
return result;
}
if ([self appRunningWithBundleIdentifier:@"com.apple.iChat"]) {
... execute script ...
}
Andreas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.