Help with setRegistry?

Eric Rivers erivers at rpsystems.net
Wed Jul 31 16:33:01 EDT 2002


Ken,

> OK, now you have all the registry settings. The next thing to do is add
some
> code to your app. When you launch an MC/Rev app, any command line
> information is sent to the application and is retrievable via *environment
> variables* numbered $0 on up. The $0 variable will always contain the path
> to the application you just launched, and the $1 will contain the first
> command-line parameter passed ($2 will be the second, etc.).
>
> So some simple code for this is:
>
> on openStack
>   put $0 into theAppPath
>   put $1 into theDocToOpen
>   answer "The doc to open is: " & theDocToOpen
> end openStack
>
> (Note that you'll need to bundle in the answer dialog box to your
standalone
> or you'll never see the message. ;-)
>
> That's it! The next time you create a document with a ".tst" extension, it
> will take on the icon in the first position in the TestApp executable (the
> document icon), and if you double-click it, it will launch TestApp and its
> path will be passed to the standalone as $1.
>
> Hope this clears things up... (and yes, I'll post this to my site in the
> MC/Revolution Tips area)

This seems to work just fine on Win32 but MacOS (specifically OS X) isn't
getting anything in the $1 variable.  The Win32 version is utilizing %1 when
calling the application to pass the file path to the document in $1.  But
trying to open the app on a Mac by launching a document never passes the
file path to the app.

The standalone is designed to either prompt for a stack file (a document) to
use when it opens or it uses the file path info of the stack that was
launched.  On Win32, the process performs nicely but on Mac it never
recognizes that a document was used to launch the standalone and prompts the
user to select a stack file, then proceeds normally.  In other words,
2X-clicking the stack launches the standalone but does not pass itself as a
parameter.

Thanks in advance for any further help you can provide.


Eric

Eric Rivers
RPSystems
http://www.rpsystems.net




More information about the Use-livecode mailing list