Send multiple parameters with apple event
I am trying to send an apple event to an application we have developed.
I want to be able to call the apple event, and at the same time pass parameters with the event. eg acctid, acctpa开发者_JS百科ssword, order number.
I'm not sure how to format the apple event being sent.
Is this possible?, and if so any guidance.
Thanks Stephen
I realise that you have accepted the given answer, but you CAN send several parameters within a single AppleEvent
.
The parameters are each placed in an AEDesc
using AECreateDesc()
and are added to the AppleEvent
with 4-character code names (OSType
).
On the receiving end, they can be retrieved by AEGetParamDesc (theAppleEvent, 4-char-code, ...);
AEGetDescData
is then used to extract the data from the AEDesc
.
You can also use lists as parameters by using AEDescList
values, which are essentially lists of AEDesc
values.
The AEBuildDesc()
and AEBuildAppleEvent()
make the whole process quite easy.
I'm not 100% sure if you can send multiple parameters with a single apple event (though I thought you could but I couldn't find anything on it), but a backup method would be, if you have control to the development of both applications, you can put all of the variables within one parameter using a format you've made to separate the variables. You can simply join them in the first app, and split them up when received in the second app.
精彩评论