What is Macintosh equivalent of relaunch handler?
Richard Gaskin
ambassador at fourthworld.com
Wed Mar 27 23:01:31 EDT 2019
Bill Vlahos wrote:
> I want to receive command line parameters in my application.
>
> The relaunch pCommandLineArguments works perfectly in Windows apps.
>
> What is the equivalent handler for MacOS X apps?
There's no direct equivalent because Mac apps run in a single instance
by default.
If you want to open a document use this:
on appleEvent theClass,theID
if theClass is "aevt" and theID is "odoc" then
request appleEvent data
put it into theFiles
if theFiles is not "not found" and theFiles is not empty then
## code to open theFiles
end if
else
pass appleEvent
end if
end appleEvent
If you want to emulate the Windows experience by having an app run in a
separate process each time it's opened, there's a command line option
for that (I can't recall what it is, but last time I looked it up it did
take long).
--
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com
More information about the use-livecode
mailing list