Sending an AE to select all
Sending an AE to select all
- Subject: Sending an AE to select all
- From: Paul Haddad <email@hidden>
- Date: Fri, 1 Nov 2002 22:48:07 -0600
Hi All,
I'm trying to send an AppleEvent to the currently active app to do a
"Select All" type of action. I'm currently using the below, but there
is something wrong with it. It gets all the way through to the end of
the method but doesn't seem to do anything.
I'm guessing the problem is with the AEPutParamPtr call, either its the
wrong function to call or I'm not setting up command correctly (or
probably both).
Can anyone help me with the correct voodoo to make this work?
---
Paul Haddad (email@hidden) AIM:(ETS Paul)
{
ProcessSerialNumber psn;
if (GetFrontProcess(&psn) != noErr)
return NO;
AEAddressDesc appDescriptor;
if (AECreateDesc(typeProcessSerialNumber, &psn, sizeof(psn),
&appDescriptor) != noErr)
return NO;
AppleEvent event;
if (AECreateAppleEvent(kEventClassCommand, kEventCommandProcess,
&appDescriptor, kAutoGenerateReturnID,
kAnyTransactionID, &event) != noErr)
return NO;
HICommand command;
bzero(&command, sizeof(command));
command.commandID = kHICommandSelectAll;
if (AEPutParamPtr(&event, keyDirectObject, typeHICommand, &command,
sizeof(command)) != noErr)
return NO;
AppleEvent reply;
if (AESend(&event, &reply, kAENoReply, kAENormalPriority,
kAEDefaultTimeout, NULL, NULL) != noErr)
return NO;
AEDisposeDesc(&event);
AEDisposeDesc(&appDescriptor);
NSLog(@"SUCCESS");
return YES;
}
_______________________________________________
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.