Thursday, August 28, 2008

Time to stretch and rest my eyes

I have been reading a lot about eye strain lately and ran across the suggestion to focus 20 feet away for 20 seconds every 20 minutes to ease eye strain. So to help with that, and to remind me to do my cube calisthenics I threw together a very simple VBScript that pops up a message every 20 minutes. And I decided to post it here so I would be able to grab it from anywhere.

The 'sleep' value is set to 1200000 milliseconds, which equals 20 minutes, but can be changed easily. The message title and message body can easily be changed as well by changing the values of the initial variables.
intSleepTime = 1200000
strMsgTitle = "Rest Time!"
strMsgBody = "Get up and stretch and rest your eyes!"

While intMessage < 2
wscript.sleep intSleepTime
intMessage = MsgBox ("Rest time!" &VbCrLf&VbCrLf& strMsgBody &VbCrLf&VbCrLf& "Click Ok to continue or Cancel to exit.", 65, strMsgTitle)
Wend


No comments: