Page 1 of 1

Time trigger or Scheduled task?

Posted: Wed Apr 20, 2016 11:19 pm
by DavJans
I need my app to do something at midnight every week day, should I wright my app like this:

on openStack
do stuff
clsoe stack
end openStack

And have windows use scheduled task to run my app at midnight.

Or,

Is there a way in live code to check the time and when time = 0:00:00, then do stuff?

Re: Time trigger or Scheduled task?

Posted: Wed Apr 20, 2016 11:49 pm
by dunbarx
Hi.

Simple to make a stack that can live forever, whether or not LC is in front or not

On a new card, make a button and a field. Put this into the button script:

Code: Select all

on mouseUp
   findMidnight
end mouseUp

on findMidNight
  if the long  time = "12:00:00 AM" then 
      put the long time & return after field 1
      wait 2 seconds
   end if
   send "findMidNight" to me in 30
end findMidNight
Now I suggest that for testing you change the time to something you can play with. And instead of just putting that time into the field, you can do something else. This will not interfere with any other LC process, and it will work regardless of what else you are doing on your computer.

Craig NEwman

Re: Time trigger or Scheduled task?

Posted: Thu Apr 21, 2016 7:02 pm
by DavJans
Thank you, works beautifully.