Jump to content

Trying to create an alerts based on a txt file


Recommended Posts

Hello everybody!
I would like help to create a simple script that alerts me daily about 10 minutes before with a beep or a msgbox... according to information contained in a txt that I feed every day. This is the txt and information model:

Schedule.txt
Monday;09:00:00;Recess
Monday;13:30:00;Music lessons
Monday;17:10:00;Boost up
Wednesday;11:45:00;School
Wednesday;17:00:00;Team meet
Fryday;12:00:00;Art/Meeting

How to start? I'm a bit of a layman, it's been a long time since I've programmed.

Thank you in advance.

Link to post
Share on other sites
  • Moderators
Posted (edited)

There are, as usual, 1000 ways to skin the proverbial cat. If this is a txt file as you state, you could do something like the following:

#include <Array.au3>

Local $file = @DesktopDir & "\Schedule.txt"
$schedule = FileReadLine($file, -1)
$aSchedule = StringSplit($schedule, ";")

_ArrayDisplay($aSchedule)

Note that you could easily do this in fewer lines, but wanted to show the steps. You could also do something like this, if you have no need to re-use the file path:

#include <Array.au3>

Local $aSchedule = StringSplit(FileReadLine(@DesktopDir & "\Schedule.txt", -1), ";")
_ArrayDisplay($aSchedule)

Once you have the information you want (Day/Time/Event) you can use these items to create a task using the Windows Task Scheduler and point it to a script that brings up your MsgBox. Search the forum; there are tons of posts on creating tasks.

Edited by JLogan3o13

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to post
Share on other sites

Why do you want to reinvent the wheel ?  There is so many (free) tools that will allow you to do exactly what you want...

Link to post
Share on other sites

JLogan3o13
Very interesting to use Windows Task Scheduler. I will research more on how to do this. Thanks!

Nine
These to-do lists are from some private students. They are all in excell that I can export in this format that is most useful to me and that I use in another system that uses this format.

JockoDundee
Hehe... some students have this privilege. :)

 

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...