我是AutoHotkey的新手,我正在寻找一些帮助。
如果我希望编写一个脚本,以便每半小时全屏调度在WMP中打开.wmv
文件,我该从哪里开始?
我知道我需要使用autohokey的run
命令。我应该使用Windows任务计划程序,还是使用AutoHotkey管理计时器会更好?
答案 0 :(得分:2)
试试这个:
VideoLengthInSeconds = 60
RunVideoEveryXMinutes = 30
TheVideoFile = C:\MyVideoFile.wmv
Loop
{
Run, wmplayer.exe "%TheVideoFile%" ;run the video in wmp
Sleep, 3000 ;wait 3 seconds
SendInput, {F11} ;send F11 to make it fullscreen
Sleep, % VideoLengthInSeconds*1000 ;wait while video is playing
Send, {alt down}{F4}{alt up} ;close the wmp
Sleep, % RunVideoEveryXMinutes*60*1000 ;wait after the video was played
}
;Use Esc to exit the script
Esc::
ExitApp