我写了一个发送'rapp'Apple事件的程序。从调试控制台我可以看到目标应用程序收到事件,并且params看起来很好。但该计划什么都不做
AppleEvent e;
AEBuildError be;
ProcessSerialNumber psn;
OSStatus result = GetProcessForPID(81188, &psn);
result = AEBuildAppleEvent(kCoreEventClass,
kAEReopenApplication,
typeProcessSerialNumber,
&psn,
sizeof(ProcessSerialNumber),
kAutoGenerateReturnID,
kAnyTransactionID,
&e,
&be,
"~'frnt':bool(@)", 0);
if(result == 0) {
result = AESendMessage(&e, NULL, kAENoReply, 0);
int x=0;
}
这是控制台输出,确保收到事件
------oo start of event oo------
aevt('aevt'\'rapp' transactionID=0 sourcePSN=[0x0,d72d72 "smart_back_test_app"] timeout=0 eventSource=3 sourceUID=1992786101 sourceGID=593637566 sourceEUID=1992786101 sourceEGID=593637566 sourcePID=81994 auditToken=[1992786101,1992786101,593637566,1992786101,593637566,81994,100005,81994]{ ~'frnt':bool(0) })
------oo end of event oo------
我做错了什么?