0
나는 콘솔에서 SIMBL이 오류가 무엇입니까 :이 디버깅하려고AppleEvent :`eventDidFail`을 디버깅하는 방법은 무엇입니까?
05.09.11 17:00:09,165 SIMBL Agent: eventDidFail:'tvea' error:Error Domain=NSOSStatusErrorDomain Code=-1708 "The operation couldn’t be completed. (OSStatus error -1708.)" (the AppleEvent was not handled by any handler) UserInfo=0x400e485c0 {ErrorNumber=-1708} userInfo:{
ErrorNumber = "-1708";
}
; 하지만 AppleEvent와는 아직 많이 일 해본 적이 없기 때문에이를 해석하는 방법을 잘 모르겠습니다.
은 내가 SIMBL 에이전트의 관련 코드는 다음과 생각 :AEEventID eventID = 'load';
// Find the process to target
pid_t pid = [[appInfo objectForKey:@"NSApplicationProcessIdentifier"] intValue];
SBApplication* app = [SBApplication applicationWithProcessIdentifier:pid];
[app setDelegate:self];
if (!app) {
SIMBLLogNotice(@"Can't find app with pid %d", pid);
return;
}
// Force AppleScript to initialize in the app, by getting the dictionary
// When initializing, you need to wait for the event reply, otherwise the
// event might get dropped on the floor. This is only seems to happen in 10.5
// but it shouldn't harm anything.
[app setSendMode:kAEWaitReply | kAENeverInteract | kAEDontRecord];
id initReply = [app sendEvent:kASAppleScriptSuite id:kGetAEUT parameters:0];
// the reply here is of some unknown type - it is not an Objective-C object
// as near as I can tell because trying to print it using "%@" or getting its
// class both cause the application to segfault. The pointer value always seems
// to be 0x10000 which is a bit fishy. It does not seem to be an AEDesc struct
// either.
// since we are waiting for a reply, it seems like this object might need to
// be released - but i don't know what it is or how to release it.
// NSLog(@"initReply: %p '%64.64s'", initReply, (char*)initReply);
// Inject!
[app setSendMode:kAENoReply | kAENeverInteract | kAEDontRecord];
id injectReply = [app sendEvent:'SIMe' id:eventID parameters:0];
if (injectReply != nil) {
SIMBLLogNotice(@"unexpected injectReply: %@", injectReply);
}
당신은 원래의 질문을 수정해야한다, 이것은 질문에 대한 답변, 단지 추가 정보는 없습니다. – uvesten
@ 입찰 : 그렇지 않습니까? 나는 실패한 명령을 발견했다. 나는 또한 오류를주는 코드를 발견했다. 그래서 나는 문제를 디버그했고 모든 정보가이 대답에있다. – Albert
좋아, 내 잘못이야. 나는 그것이 실패한 이유에 대한 대답보다 해결 방법이 더 많다고 생각했다. 나는 지금 조용히 할게. – uvesten