Page 1 of 1

sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 8:00 pm
by Thierry
Hi Livecoders,

Completely new to appleevents within Livecode,
I'm stuck with this question:

how do I *send* an event with custom parameters?

Thanks for any hints

Regards,

Thierry

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 8:29 pm
by FourthWorld
I believe arbitrary data is normally sent as the payload with a "send <message> to <app>" command, no?

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 8:40 pm
by Thierry
FourthWorld wrote:I believe arbitrary data is normally sent as the payload with a "send <message> to <app>" command, no?
Umm, may be :?

This works:

Code: Select all

send "xyz.txt" to program "anApplication" with "aevtodoc"
And now I need to add 'Revo', creator signature as a custom parameter (applescript terminology)

How would do you that?

Regards,

Thierry

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 8:46 pm
by FourthWorld
I'll have to leave that to someone with more AppleScript experience. For IAP I generally just use sockets, much faster and cross-platform.

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 9:13 pm
by Thierry
FourthWorld wrote:I'll have to leave that to someone with more AppleScript experience. For IAP I generally just use sockets, much faster and cross-platform.
This is a no-go for me in my context!

AppleEvents are my only option :(

Regards,

Thierry

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 9:23 pm
by FourthWorld
Do you really need "Revo" as a custom param? If you're also writing the recipient, couldn't any additional data be sent with the payload?

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 9:32 pm
by bn
Hi Thierry,

http://forums.runrev.com/phpBB2/viewtop ... f=8&t=4960

there is an example how to do applescript variables in Livecode and send them with the body of the applescript.

Kind regards

Bernd

Re: sending appleevent with custom parameters

Posted: Tue Mar 18, 2014 10:34 pm
by Thierry
bn wrote:there is an example how to do applescript variables in Livecode and send them with the body of the applescript.
Thanks Bernd, I'll read all that carefully but my feeling is that won't work.

@Richard: yes, the external app is waiting for it, so it can send back to Livecode
other's events when necessary. And I don't have any control on this app, except to talk
with it the way it has to be!

By the way, the "send to program in the dictionnary" is a bit weird...
( text missing, dead link to some references)
Doesn't look like a lot of coders have read this?

Regards

Thierry

Re: sending appleevent with custom parameters

Posted: Wed Mar 19, 2014 1:30 pm
by Thierry
Hi,
From Runrev support:
It is unfortunately not possible to send multiple parameters with an AppleEvent in LiveCode.
I confirmed this with our developers who looked at
how we handle Apple events via the current implementation of the “send to
program” command within the engine.

At present is only supports one parameter.

There is a light at the end of the tunnel though, as there was some discussions of
updating this ..
Well, all is said :(