Distinguishing CLI from GUI

Richard Gaskin ambassador at fourthworld.com
Mon Jun 13 12:53:30 EDT 2011


Jacque wrote:

> On 6/13/11 7:41 AM, Richard Gaskin wrote:
>
>> 2. If this is indeed a documentation bug and what I see in my tests is
>> what happens for everyone, how can I determine whether the app was
>> launched with "-ui" or not?
>
> Have you tried "if there is a window <mainstack> then..." ?

Thanks for the idea -

I had no success trying either that or "if the windows is empty", but I 
did find something useful which may be promising:

Apparently, the windowID of the mainstack is 1 when launched with -ui, 
and 0 when launched normally.

On OS X and Linux this works great:  I simply check the windowID, and if 
it's 1 then I finish what I'm doing and quit when run with -ui.

On Windows XP, however, I run into an odd issue:  I can find a way to 
have the app quit itself after launching with -ui without generating an 
OS error.

Anyone here have experience using faceless standalones on Windows that 
might help solve that?



BTW: My report bug was unnecessary - seems Mark Wieder had reported this 
issue some time ago:
<http://quality.runrev.com/show_bug.cgi?id=1644>

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the use-livecode mailing list