What is Macintosh equivalent of relaunch handler?

Bill Vlahos bvlahos at mac.com
Thu Mar 28 12:18:47 EDT 2019


Mark,

That is unfortunate. The 3rd party middleware tool I’m using to send command line parameters doesn’t support AppleEvents. It only supports sending command line parameters.

Please consider adding a feature that will let me catch the command line parameters for Mac apps like relaunch does for Windows.

I noticed the following command line reference in the 9.0.4 rc 1 release notes. Isn’t this the kind of thing I’m asking for? If so, how does it work?
> It is also possible to deactivate LiveCode with:
>        <livecode> deactivate
> LiveCode 9.0.4-rc-1 Release Notes 3/28/19
> Since LiveCode is actually a GUI application, it needs to be run slightly differently from other command-line programs.
> On Windows, the command is:
> start /wait <livecode> activate -file LICENSE -passphrase SECRET start /wait <livecode> deactivate
> On Mac OS X, you need to do:
> <livecode>/Contents/MacOS/LiveCode activate -file LICENSE -passphrase SECRET <livecode>/Contents/MacOS/LiveCode deactivate


Thank you,
Bill Vlahos

> On Mar 28, 2019, at 8:34 AM, Mark Waddingham via use-livecode <use-livecode at lists.runrev.com> wrote:
> 
> Hi Bill,
> 
>> I want my application to be able to catch parameters sent to it via
>> the command line.
>> The relaunch handler does that for Windows applications and also
>> doesn’t open another instance of the application. You are correct that
>> Mac apps run in a single instance by default and that is the behavior
>> I want.
>> I don’t want to open a document…I want to do something with the
>> command line parameters sent to my app.
> 
> The simple answer is that there isn't an equivalent.
> 
> The relaunch mechanism on Windows was added to make it easy to add single-instance like behavior on Windows (just as macOS has).
> 
> However remember that macOS has the AppleEvent system for making it easy to do inter-process communication, so on Mac you could use that.
> 
> i.e. Make the command-line tool use AppleScript (either by do ... as applescript) or the 'send to program' syntax to send apple events to instruct the main app.
> 
> Warmest Regards,
> 
> Mark.
> 
> -- 
> Mark Waddingham ~ mark at livecode.com <mailto:mark at livecode.com> ~ http://www.livecode.com/ <http://www.livecode.com/>
> LiveCode: Everyone can create apps




More information about the use-livecode mailing list