Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <TrayConstants.au3>
- Global $fFlag = False
- Opt("TrayMenuMode", 3)
- Opt("TrayOnEventMode", 1)
- TrayCreateItem("Exit")
- TrayItemSetOnEvent(-1, "ExitScript")
- TraySetToolTip("Presentation Macro")
- TrayTip("", "Slide Presenter Ready", 5, $TIP_NOSOUND)
- While 1
- If WinActive("[CLASS:screenClass]") And $fFlag = False Then
- HotKeySet ( "{F5}", "startVideo" )
- HotKeySet ( "b", "stopVideo" )
- $fFlag = True
- ConsoleWrite("presentation")
- ElseIf WinActive("[CLASS:PPTFrameClass]") And $fFlag = True Then
- HotKeySet ( "{F5}")
- HotKeySet ( "b")
- $fFlag = False
- ConsoleWrite("powerpoint")
- EndIf
- Sleep(100)
- WEnd
- Func startVideo()
- MouseMove(@DesktopWidth/2, @DesktopHeight/2, 1)
- MouseMove(@DesktopWidth/2, @DesktopHeight/3, 1)
- MouseMove(@DesktopWidth/100, @DesktopHeight/100, 1)
- Send("{ALTDOWN}{p}{ALTUP}")
- sleep(50)
- Send("{a}")
- ConsoleWrite("playtoggle")
- EndFunc
- Func stopVideo()
- Send("{ALTDOWN}{q}{ALTUP}")
- ConsoleWrite("stop")
- EndFunc
- Func ExitScript()
- Exit
- EndFunc
Advertisement