-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptiPause-20-20.vbs
More file actions
30 lines (22 loc) · 989 Bytes
/
Copy pathOptiPause-20-20.vbs
File metadata and controls
30 lines (22 loc) · 989 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Set Sapi = Wscript.CreateObject("SAPI.SpVoice")
set wshshell = wscript.CreateObject("wscript.shell")
While True
' Showing a popup, which disappears after 5 seconds
wshShell.Popup "It's time to take a break. Look at something 20 feet away for 20 seconds.", 5, "Take a Break", vbInformation
' Prompt user to take a break
Sapi.speak "It's time to take a break. Look at something 20 feet away for 20 seconds."
'Invoke the HTA script to display the image
wshShell.Run "HTA.hta", 1, False
Dim Duration
Duration = 20
' Speak countdown from 1 to 20
For i = 1 to Duration
Sapi.speak i
WScript.Sleep 250 ' Wait 0.5 seconds between each number
Next
' Display a message box with the reminder
Sapi.speak "Great, Next reminder in 20 minutes"
wshShell.Popup "Good, Next reminder in 20 minutes", 5, "Break Reminder", vbInformation
' Wait for 20 minutes
WScript.Sleep(20 * 60 * 1000) ' 20 minutes in milliseconds
Wend