What is Macintosh equivalent of relaunch handler?

Mark Waddingham mark at livecode.com
Fri Mar 29 15:20:59 EDT 2019


On 2019-03-29 19:57, Bill Vlahos via use-livecode wrote:
> The existing application can do 2 things.
> It can send command line parameters
> It can send a formatted URL
> 
> I can either catch the command line parameters - which is what I’ve
> been asking for or write the application to be a server responding to
> a URL sent to localhost.
> 
> The latter seems overly complicated and could introduce latency which
> I don’t want.

What you want requires some sort of IPC (inter process communication) 
and local sockets are highly efficient on UNIX based OSes (being part of 
the kernel) so I wouldn't worry about latency (not unless you manage to 
find it being an issue!).

You can do what you want with AppleScript (see the 'osascript' command 
line tool - or have your app's on startup handler check for arguments 
which mean send to main app, use do as applescript then exit) - and have 
your app respond to apple events with an 'on appleEvent' handler. 
(AppleEvents probably use sockets underneath...)

Or, indeed, you could try using the httpd library which is one of the 
script libraries introduced in 9.0 (IIRC). See httpdStart in the 
dictionary - its *really* easy to use :)

Warmest Regards,

Mark.

-- 
Mark Waddingham ~ mark at livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps




More information about the use-livecode mailing list