sending appleevent with custom parameters

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

sending appleevent with custom parameters

Post by Thierry » Tue Mar 18, 2014 8:00 pm

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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: sending appleevent with custom parameters

Post by FourthWorld » Tue Mar 18, 2014 8:29 pm

I believe arbitrary data is normally sent as the payload with a "send <message> to <app>" command, no?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: sending appleevent with custom parameters

Post by Thierry » Tue Mar 18, 2014 8:40 pm

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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: sending appleevent with custom parameters

Post by FourthWorld » Tue Mar 18, 2014 8:46 pm

I'll have to leave that to someone with more AppleScript experience. For IAP I generally just use sockets, much faster and cross-platform.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: sending appleevent with custom parameters

Post by Thierry » Tue Mar 18, 2014 9:13 pm

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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10053
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: sending appleevent with custom parameters

Post by FourthWorld » Tue Mar 18, 2014 9:23 pm

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?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4174
Joined: Sun Jan 07, 2007 9:12 pm

Re: sending appleevent with custom parameters

Post by bn » Tue Mar 18, 2014 9:32 pm

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

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: sending appleevent with custom parameters

Post by Thierry » Tue Mar 18, 2014 10:34 pm

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
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Thierry
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 875
Joined: Wed Nov 22, 2006 3:42 pm

Re: sending appleevent with custom parameters

Post by Thierry » Wed Mar 19, 2014 1:30 pm

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 :(
!
SUNNY-TDZ.COM doesn't belong to me since 2021.
To contact me, use the Private messages. Merci.
!

Post Reply