Can anyone tell me why this AppleEvent code isn't working?
Can anyone tell me why this AppleEvent code isn't working?
- Subject: Can anyone tell me why this AppleEvent code isn't working?
- From: Varun Mehta <email@hidden>
- Date: Sat, 27 Jul 2002 10:07:16 -0400
If thought that this code would work to tell iTunes to play or pause, but it
doesn't seem to be executing the event, but gives no error on compile and no
problems show up in console. This code is an adaptation from the code that
ClassicSpy uses to send a Quit Event to Classic. I have adapted the daemon
for it so that it has no problems sending a standard Quit Event to iTunes.
AEAddressDesc clasSprt;
AppleEvent anAppleEvent, reply;
if (classicRunning) {
if (AECreateDesc(typeNull, NULL, sizeof(reply), &reply) == noErr) {
if (AECreateDesc('hook', &iTunesPSN, sizeof(ProcessSerialNumber),
&clasSprt) == noErr) {
if (AECreateAppleEvent('hook', 'PIPs', &clasSprt,
kAutoGenerateReturnID, kAnyTransactionID, &anAppleEvent) == noErr) {
// Send the Apple Event.
if(AESend(&anAppleEvent, &reply, kAENoReply, kAENormalPriority,
kAEDefaultTimeout, nil, nil) != noErr)
NSLog(@"iTunes: AESend error");
AEDisposeDesc(&anAppleEvent); // Dispose of the Apple Event.
} //else NSLog(@"AECreateAppleEvent error %d", err);
AEDisposeDesc(&clasSprt);
} //else NSLog(@"AECreateDesc 2 error %d", err);
AEDisposeDesc(&reply);
} //else NSLog(@"AECreateDesc 1 error %d", err);
}
I'm sure the problem is simple, but no examples or reference is telling me
anything as to why this isn't working. Any AppleEvent masters out there to
help me out?
Thanks,
Varun Mehta
_______________________________________________
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.