1

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, acctpassword, order number.

I'm not sure how to format the apple event being sent.

Is this possible?, and if so any guidance.

Thanks Stephen

Stephen Baugh
  • 673
  • 1
  • 9
  • 24

2 Answers2

3

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.

Ryan Endacott
  • 8,772
  • 4
  • 27
  • 39
Jackeen
  • 31
  • 3
2

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.

mjdth
  • 6,536
  • 6
  • 37
  • 44