Running an app without human intervention (no buttons)

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
horacapp
Posts: 3
Joined: Wed Jun 08, 2016 1:59 pm

Running an app without human intervention (no buttons)

Post by horacapp » Wed Jun 08, 2016 2:14 pm

Hi
How can i run an app without human intervention (no buttons)?
After compilation, when I double click the app, the app start, run and finish without pressing any button.
Thank you

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Running an app without human intervention (no buttons)

Post by dunbarx » Wed Jun 08, 2016 3:01 pm

Hi.

Make a new stack. Save it. In the card script:

Code: Select all

on opencard
   repeat with y = 1 to 10
      revSpeak y
      wait 60
   end repeat
end opencard
Now close the stack and reopen it.

Craig Newman

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Running an app without human intervention (no buttons)

Post by Mikey » Thu Jun 09, 2016 2:07 pm

Also, you can set the loc of the stack to be somewhere off-screen. There are some other tricks, as well, but start with these two.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Running an app without human intervention (no buttons)

Post by dunbarx » Thu Jun 09, 2016 2:14 pm

Mike.

I see what you are getting at, but I think the OP wanted an automatically initialized and running stack that required no user action, not a stack that simply was never seen.

But we might need to hear back to really know...

Craig

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Running an app without human intervention (no buttons)

Post by Mikey » Thu Jun 09, 2016 2:19 pm

Yes, I get that. I was just trying to answer the next question, before it might be asked. The one after that, I expect, would be how to have the app run completely facelessly, but I figured I would leave that for someone else to jump for. Besides, I didn't want to start the debate over why you didn't suggest on startup or on openStack or on preopenstack etc., or worse, why you used on instead of command.

(ducks)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10330
Joined: Wed May 06, 2009 2:28 pm

Re: Running an app without human intervention (no buttons)

Post by dunbarx » Thu Jun 09, 2016 2:31 pm

Fires low to catch ducking LC'er.

I am old-fashioned, and use "on" everywhere. Just a habit. I suppose for readability and communal commonality I ought to change.

But know that system messages (like the three you mentioned) all generally should use "on", and only custom ones use "command". I did suggest "openCard", after all.

The ones you mentioned would work as well, and if you wanted to both hide and set the loc offscreen, "preOpenStack" would have been better. But remember, I was not hiding anything.

Craig

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Running an app without human intervention (no buttons)

Post by FourthWorld » Thu Jun 09, 2016 4:48 pm

FWIW LC apps can be launched from the command line by adding a -ui flag.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 10099
Joined: Fri Feb 19, 2010 10:17 am

Re: Running an app without human intervention (no buttons)

Post by richmond62 » Thu Jun 09, 2016 6:10 pm

Why does "Running an app without human intervention" make me
start thinking about computer viruses?

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Running an app without human intervention (no buttons)

Post by Mikey » Thu Jun 09, 2016 6:39 pm

no idea, but I have several daemons that I run on various machines that are written in LC, and given that on at least two of those machines, I have to fight with Norton with each new version, I would say that the malware checkers are on to us...

Post Reply