jagreygoose

Presentation Macro Snippet

Jun 12th, 2014
3,875
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
AutoIt 1.05 KB | None | 0 0
  1. #include <TrayConstants.au3>
  2. Global $fFlag = False
  3.  
  4. Opt("TrayMenuMode", 3)
  5. Opt("TrayOnEventMode", 1)
  6. TrayCreateItem("Exit")
  7. TrayItemSetOnEvent(-1, "ExitScript")
  8.  TraySetToolTip("Presentation Macro")
  9. TrayTip("", "Slide Presenter Ready", 5,  $TIP_NOSOUND)
  10.  
  11. While 1
  12.    If WinActive("[CLASS:screenClass]")  And $fFlag = False Then
  13.       HotKeySet ( "{F5}", "startVideo" )
  14.       HotKeySet ( "b", "stopVideo" )
  15.       $fFlag = True
  16.        ConsoleWrite("presentation")
  17.    ElseIf WinActive("[CLASS:PPTFrameClass]") And $fFlag = True Then
  18.       HotKeySet ( "{F5}")
  19.       HotKeySet ( "b")
  20.       $fFlag = False
  21.        ConsoleWrite("powerpoint")
  22.    EndIf
  23.    Sleep(100)
  24. WEnd
  25.  
  26. Func startVideo()
  27.    MouseMove(@DesktopWidth/2, @DesktopHeight/2, 1)
  28.    MouseMove(@DesktopWidth/2, @DesktopHeight/3, 1)
  29.    MouseMove(@DesktopWidth/100, @DesktopHeight/100, 1)
  30.    Send("{ALTDOWN}{p}{ALTUP}")
  31.    sleep(50)
  32.    Send("{a}")
  33.    ConsoleWrite("playtoggle")
  34. EndFunc
  35.  
  36.  
  37. Func stopVideo()
  38.    Send("{ALTDOWN}{q}{ALTUP}")
  39.    ConsoleWrite("stop")
  40. EndFunc
  41.  
  42.  
  43. Func ExitScript()
  44.     Exit
  45. EndFunc
Advertisement