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!
Open Certain file schedule
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Open Certain file schedule
Hi Kulcanhez,
welcome to the forum!
Out of my head, something like this:
1. convert the user selected time to seconds -> userTime
2. convert the current time to seconds -> tNow
3.
You get the picture.
Hint:
The app has to be open all the time or this will not work!
Best
Klaus
welcome to the forum!
Out of my head, something like this:
1. convert the user selected time to seconds -> userTime
2. convert the current time to seconds -> tNow
3.
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
Hint:
The app has to be open all the time or this will not work!
Best
Klaus
-
- VIP Livecode Opensource Backer
- Posts: 9647
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Open Certain file schedule
Here is another way, that you may find fun to play with. In a button script:
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
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
Craig Newman
Re: Open Certain file schedule
Thank you very much I will try