I have created a very basic script in VBS that I am using in Theater view to stop playback after a certain amount of time (I have 3 scripts, 30, 60, and 90 minutes). Used for watching TV at night, so when my wife falls asleep, the TV doesn't run all night.
I would like to add some sort of code to confirm the selection, because as it is, there is no feedback that the timer is actually running...I also would like it to work with a remote (my remote sends left/right cursor commands, so should be fairly easy).
Here is the code I am trying:
x=msgbox("Are you sure you want to stop playback after 30 minutes?" ,vbSystemModal + vbYesNo, "Stop Playback")
if x = vbYes then
Wscript.sleep 1800000
CreateObject("Wscript.Shell").Run "C:\Windows\System32\MC20.exe /MCC 10002"
end if
The problem is, that the msgbox doesn't have focus, so my remote commands are being sent to MC instead of the msgbox...
I was hoping someone here might have a more elegant solution, or perhaps there is a built-in way to do what I want...
For now, I just took out the msgbox, and am living with no feedback, or cancel option, but that is not a good longterm solution.