X-Git-Url: http://git.ithinksw.org/ITMac.git/blobdiff_plain/d056aaa84f4243e49ae15a6dd39b303694db086c..9c87a04ce0a9224430e24487efb73fab17078c31:/ITAppleEventTools.m diff --git a/ITAppleEventTools.m b/ITAppleEventTools.m index 0fe0b76..a61f5a4 100644 --- a/ITAppleEventTools.m +++ b/ITAppleEventTools.m @@ -45,6 +45,10 @@ NSAppleEventDescriptor *ITSendAEWithKey(FourCharCode reqKey, FourCharCode evClas } NSAppleEventDescriptor *ITSendAEWithString(NSString *sendString, FourCharCode evClass, FourCharCode evID, const ProcessSerialNumber *psn) { + ITSendAEWithStringAndTimeout(sendString, evClass, evID, psn, 60); +} + +NSAppleEventDescriptor *ITSendAEWithStringAndTimeout(NSString *sendString, FourCharCode evClass, FourCharCode evID, const ProcessSerialNumber *psn, long timeout) { pid_t pid; AppleEvent sendEvent, replyEvent; AEDesc resultDesc; @@ -66,7 +70,7 @@ NSAppleEventDescriptor *ITSendAEWithString(NSString *sendString, FourCharCode ev return nil; } - err = AESend(&sendEvent, &replyEvent, kAEWaitReply, kAENormalPriority, /*kAEDefaultTimeout*/60, NULL, NULL); + err = AESend(&sendEvent, &replyEvent, kAEWaitReply, kAENormalPriority, /*kAEDefaultTimeout*/timeout, NULL, NULL); AEDisposeDesc(&sendEvent); if (err) {