git.ithinksw.org
/
ITFoundation.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
c897ec0
)
ITSendAEWithString returns the direct object AEDesc, or returns 0 if there is none.
author
Kent Sutherland
<ksuther@ithinksw.com>
Sun, 25 Apr 2004 15:24:19 +0000
(15:24 +0000)
committer
Kent Sutherland
<ksuther@ithinksw.com>
Sun, 25 Apr 2004 15:24:19 +0000
(15:24 +0000)
ITAppleEventTools.m
patch
|
blob
|
history
diff --git
a/ITAppleEventTools.m
b/ITAppleEventTools.m
index
217a1d1
..
9eaacb1
100755
(executable)
--- a/
ITAppleEventTools.m
+++ b/
ITAppleEventTools.m
@@
-19,7
+19,9
@@
NSAppleEventDescriptor *ITSendAEWithString(NSString *sendString, FourCharCode ev
AppleEvent sendEvent, replyEvent;
NSAppleEventDescriptor *send, *recv;
AppleEvent sendEvent, replyEvent;
NSAppleEventDescriptor *send, *recv;
- AEDesc nthDesc;
+ AEDesc resultDesc;
+ DescType resultType;
+ Size resultSize;
AEBuildError buildError;
OSStatus berr,err;
AEBuildError buildError;
OSStatus berr,err;
@@
-39,10
+41,14
@@
NSAppleEventDescriptor *ITSendAEWithString(NSString *sendString, FourCharCode ev
err = AESend(&sendEvent, &replyEvent, kAEWaitReply, kAENormalPriority, kNoTimeOut, NULL, NULL);
err = AESend(&sendEvent, &replyEvent, kAEWaitReply, kAENormalPriority, kNoTimeOut, NULL, NULL);
- err = AEGetNthDesc(&replyEvent, 1, typeWildCard, nil, &nthDesc);
- if (!err) ITDebugLog(@"Error getting Nth desc.");
+ err = AESizeOfParam(&replyEvent, keyDirectObject, &resultType, &resultSize);
+ if (resultSize == 0 || err != 0) {
+ return nil;
+ }
+
+ AEGetParamDesc(&replyEvent, keyDirectObject, resultType, &resultDesc);
- recv = [[[NSAppleEventDescriptor alloc] initWithAEDescNoCopy:&
nth
Desc] autorelease];
+ recv = [[[NSAppleEventDescriptor alloc] initWithAEDescNoCopy:&
result
Desc] autorelease];
if (!err) [recv logDesc];
if (err) {
if (!err) [recv logDesc];
if (err) {