Re: Determinating iChat status
Re: Determinating iChat status
- Subject: Re: Determinating iChat status
- From: David Remahl <email@hidden>
- Date: Mon, 31 May 2004 15:34:58 +0200
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On 31 maj 2004, at 14.47, Andreas Mayer wrote:
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
Unfortunately (?) it is possible to be online even when iChat is not
running. The menu extra can keep the connection alive, starting iChat
only when messages arrive.
File bug reports with Apple, requesting public API's for communicating
with iChat.
If you can afford to exploit private API's, then there is
InstantMessaging.framework. I am the author of iChatStatus, so Aidas
can contact me if he wants to look at it [Warning: dangerous hacks...].
/ Regards, David Remahl
- --- PGP key information---
pub 1024D/ 87256085 2003/06/12 David Remahl <email@hidden>
Web:
http://ittpoi.com/david_remahl.asc
Fingerprint: 0C38 293C 86A9 7756 9CEA 4ED6 1651 620E 8725 6085
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (Darwin)
iD8DBQFAuzRrFlFiDoclYIURAkHQAJwLzv/9aTQISLJ/kV0OKRsErkiObwCfb5p0
QnMFyG4hhxT5aXvHBkdvY84=
=fAbY
-----END PGP SIGNATURE-----
_______________________________________________
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.