Can LiveCode create a command line or console application

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
cosnet1BUSk1Aq
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10
Joined: Wed Apr 18, 2012 9:58 pm

Can LiveCode create a command line or console application

Post by cosnet1BUSk1Aq » Wed Apr 18, 2012 10:12 pm

Hi,
I am new to LiveCode and really I have not done programming in 15 years (even though that is what my degree is in). I work for a company where main development is done in Germany but there are certain features that our customer base here in the USA needs or wants. I have two in mind but one big one would be to create an application that is command line driven. We have a scripting engine in our own software which can drive these. So the script would execute something like: myapp.exe arg1 arg2 and so on.
I know one of the beautiful parts of LiveCode is how easy it creates GUI's , etc. but I want a Gui-less app.
Thanks..
Bruce

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Can LiveCode create a command line or console applicatio

Post by mwieder » Wed Apr 18, 2012 10:27 pm

Bruce-

Yep. I do this fairly often. There are a few tricks to it, but it works well if you follow them.

In the openStack handler on the first card I hide the stack. Set the hideconsolewindows to true if you're going to be issuing shell commands in the app, or else you'll see a bunch of windows popping up and disappearing. Read the commandline arguments in the startup handler and either process them there or do some preprocessing and then deal with them later on.

And the engine eats some commandline options on its own as well. There's an old message attached to a bug report that details what they are - I'll try to dig it up and post it here.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Contact:

Re: Can LiveCode create a command line or console applicatio

Post by mwieder » Wed Apr 18, 2012 10:29 pm

Found it.

Code: Select all

          [-d[isplay] displayname]
          [-f[iles] (disable access to files and processes)
          [-g[eometry] ={+-}<xoffset>{+-}<yoffset>]
          [-i[nput] fd] read commands from fd (0 is stdin) or named pipe
          [-m[map]] (don't memory map files)
          [-n[opixmaps]] (draw direct to screen)
          [-p[ointerfocus]] (use active focus)
          [-s[haredoff]] (don't use shared memory server extension)
          [+s[haredon]] (use shared memory server extension)
          [-u[i]] (don't create graphical user interface)
          [-v[isualid] n] (use visual id n as listed from xdpyinfo)
          [-w[indowid] n] (watch window id n for commands)

cosnet1BUSk1Aq
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10
Joined: Wed Apr 18, 2012 9:58 pm

Re: Can LiveCode create a command line or console applicatio

Post by cosnet1BUSk1Aq » Thu Apr 26, 2012 2:03 pm

Thanks. Looks like I will have to get out the checkbook. ;-)

Post Reply