OSX Opening an App with a document

Trevor DeVore lists at mangomultimedia.com
Thu Oct 6 23:08:06 EDT 2016


On Thu, Oct 6, 2016 at 12:44 PM, J. Landman Gay <jacque at hyperactivesw.com>
wrote:

> You can create your own system globals by prepending "$" to the variable
> name. If you do that in the appleEvent handler then later whenever you need
> it, you can access the global. Unless things have changed since I last used
> it, appleEvent is sent immediately during startup .
>
> Or you could use a script local the same way.
>

This is similar to how I handle it in the GLX App Framework. The framework
sets a flag when the app has finished loading. If the appleEvent is
received before that flag is set then I store the files passed to the
appleevent in a "command line files" property (accessed by
glxapp_getProp("command line files")). Otherwise the framework sends
the glxapp_openFiles
message from the appleevent with the files as a parameter.

In the glxapp_openApplication message the developer can check if
glxapp_getProp("command
line files") has a non-empty value. If it does then the developer can
process the files passed on the command line. glxapp_openApplication is
sent after all resources for the application have loaded and the app is
ready to display something to the user.

-- 
Trevor DeVore
ScreenSteps
www.screensteps.com    -    www.clarify-it.com



More information about the use-livecode mailing list