From: Kent Sutherland Date: Sat, 11 Sep 2004 02:03:14 +0000 (+0000) Subject: I hope it commits this time. Tinkered with ITSendAEWithKey X-Git-Tag: v1.0~13 X-Git-Url: http://git.ithinksw.org/ITFoundation.git/commitdiff_plain/81fa921043ee6335a578360e220d1d6e3bf838ad I hope it commits this time. Tinkered with ITSendAEWithKey --- diff --git a/ITAppleEventTools.m b/ITAppleEventTools.m index 2677636..9f7462e 100755 --- a/ITAppleEventTools.m +++ b/ITAppleEventTools.m @@ -108,12 +108,8 @@ NSAppleEventDescriptor *ITSendAEWithKey(FourCharCode reqKey, FourCharCode evClas { //Add error checking... pid_t pid; - - unsigned char *chr = (unsigned char *)malloc(4*sizeof(unsigned char)); - memcpy(chr, &reqKey, 4); - NSString *sendString = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('%s'), from:'null'() }", chr]; - free(chr); - const char *usendString = [sendString UTF8String]; + NSString *sendString = [NSString stringWithFormat:@"'----':obj { form:'prop', want:type('prop'), seld:type('%c%c%c%c'), from:'null'() }", (reqKey >> 24), (reqKey >> 16) & 0xff, (reqKey >> 8) & 0xff, reqKey & 0xff]; + const char *usendString = [sendString UTF8String]; AppleEvent sendEvent, replyEvent; NSAppleEventDescriptor *send, *recv;