AutoHotKey
특정 시간에 원하는 프로그램/파일 실행
쵸코난
2021. 10. 23. 11:36
1초마다 루프를 돌다가 만일 현재시간이 주어진 시간(12:34:56형식)과 같으면
Target에 입력된 특정 프로그램이나 pptx, ppsx 과 같은 특정 파일을 여는 것입니다.
ppsx로 만들어 Target에 넣으면 바로 슬라이드쇼가 실행됩니다.
Target 에는 아래와 같은 명령이 가능합니다.
C:\Windows\notepad.exe
c:\users\사용자이름\Desktop\Sample123.pptx
""C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE"" /S ""C:\Users\사용자이름\Desktop\Slide3.pptm""
""C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE"" /B
Start를 누르면 트레이에 상주합니다.
다시 Tray 아이콘을 우클릭하면 Show와 Exit 기능만 있습니다.
다른 시간, 다른 프로그램/명령으로 하려면 프로그램을 종료하고 재시작하세요.
더보기
;http://www.autohotkey.co.kr/cgi/board.php?bo_table=script&wr_id=433&page=2
;#notrayicon
FormatTime, curtime,,HH:mm:ss
Gui, Add, Text, Left x5 y10 w40 h20 , Target:
Gui, Add, Edit, vtarget g2 left x50 y10 w300 h20, %A_Desktop%\Slide1.ppsx
Gui, Add, Text, left x5 y34 w100 h20 , Run at:
Gui, Add, Edit, vruntime g1 left x50 y32 w60 h20,%curtime%
Gui, Add, Text, left x115 y34 w80 h20, (hh:mm:ss)
Gui, Add, Text, left x5 y57 w100 h20, Now:
Gui, Add, Text, v2 Left x50 y57 w60 h20, CurrentTime
Gui, Add, Button, g3 vBtn x250 y35 w100 h40 , Start
Gui, Show, x1 y1 h90 w360, RunAt
loop {
FormatTime, curtime,,HH:mm:ss
guicontrol, ,2, %curtime%
sleep 1000
}
Return
1:
return
2:
return
3:
guicontrol,text,Btn,Started
guicontrol, Disable, runtime
guicontrol,Disable,Btn
Gui,submit,Hide
;Gui,destroy
#SingleInstance off
#persistent
Menu, Tray, Tip , RunAt
Menu, Tray, Icon, shell32.dll,266
Menu, Tray, NoStandard
Menu, Tray, add, Show, Show
Menu, Tray, add, Quit, GuiClose
loop
{
FormatTime, curtime,,HH:mm:ss
guicontrol, ,2, %curtime%
if (runtime = curtime)
{
;msgbox, %runtime% %curtime% %target%
run, %target%
;run, c:\users\user\Desktop\Sample15by20s.pptx
;run, ""C:\Program Files\Microsoft Office\root\Office16\POWERPNT.EXE"" /S ""C:\Users\User\Desktop\Slide2Handout_.pptm""
}
sleep 1000
}
return
Begin:
IfWinExist, RunAt
WinActivate, RunAt
IfWinNotExist, RunAt
Goto, Show
Return
Show:
Gui, Show, , RunAt
Menu, Tray, ToggleEnable, Show
Return
#x::
ExitApp
GuiClose:
ExitApp
파일 다운로드: