Open Certain file schedule

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: heatherlaine, Klaus, FourthWorld, kevinmiller

Post Reply
Posts: 6
Joined: Sat Oct 08, 2016 6:42 pm

Open Certain file schedule

Post by Kulcanhez » Thu Apr 20, 2017 9:42 pm

Hello everyone,
I'm learning LiveCode, I know LiveCode for some time but just now I'm learning it.
I'm developing a simple app for desktop that open a certain file at time the user want. Just a simple interface that the user choose the file and the time, and when reach that time it open the file. How can I do this?
Thank you very much!

Posts: 9978
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany

Re: Open Certain file schedule

Post by Klaus » Thu Apr 20, 2017 10:32 pm

Hi Kulcanhez,

welcome to the forum! :D

Out of my head, something like this:
1. convert the user selected time to seconds -> userTime
2. convert the current time to seconds -> tNow

Code: Select all

send "launch_user_file" to this stack in userTime - tNow seconds
## or top wherever you store the command, see below

Code: Select all

## Put this e.g. into stack script
command launch_user_file tUserSelectedFile
  launch document tUserSelectedFIle
end launch_user_file
You get the picture. :D

The app has to be open all the time or this will not work!



VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5323
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Open Certain file schedule

Post by dunbarx » Thu Apr 20, 2017 10:56 pm

Here is another way, that you may find fun to play with. In a button script:

Code: Select all

on mouseUp
   ask "Enter start time"
setTime it
end mouseUp

on setTime tStartTime
   if the optionKey is down then exit to top
   if the time = tStartTime then
      Beep 3
      answer "Right NOW!"
      exit to top
   end if
   send "setTime" && tStartTime to me in 5
end setTime
You can stop this at any time by pressing the optionKey, and you can do any other task while it is running. The way it is written, at least in the US, you would enter something like "6:15 PM". But this can be modified in many ways.

Craig Newman

Posts: 6
Joined: Sat Oct 08, 2016 6:42 pm

Re: Open Certain file schedule

Post by Kulcanhez » Fri Apr 21, 2017 7:37 am

Thank you very much I will try :)

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”