test.ahk 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. f5::
  2. try{
  3. ppt := ComObjActive("PowerPoint.Application")
  4. objppt := ppt.ActivePresentation
  5. TotalSlides:=% objppt.Slides.Count
  6. }
  7. catch e {
  8. MsgBox % "Error in " e.Message ", which was called at line " e.Line
  9. }
  10. Loop %TotalSlides%{
  11. var++
  12. ;MsgBox %var%
  13. saveppt := objppt.Slides(var).Export(A_ScriptDir . "\" . var . ".png", "PNG")
  14. }
  15. ;pt := ppt.ActivePresentation.(test, ppSaveAsPNG)
  16. SysGet, MonitorCount, MonitorCount
  17. ;MsgBox %MonitorCount%
  18. MsgBox saved
  19. ;MsgBox inside %MonitorCount%
  20. ppt := objppt.SlideShowSettings
  21. ppt.Run
  22. monitorDisplay(objppt, MonitorCount)
  23. Return
  24. Right::
  25. objppt.SlideShowWindow.View.Next
  26. monitorDisplay(objppt, MonitorCount)
  27. return
  28. monitorDisplay(objppt, MonitorCount){
  29. CurrentSlideNumber :=% objppt.SlideShowWindow.View.Slide.SlideIndex
  30. MsgBox %CurrentSlideNumber% is the current slide
  31. monitor := MonitorCount-1
  32. Loop %monitor%{
  33. MsgBox insideloop
  34. var2++
  35. setDisplay(var2, CurrentSlideNumber-1)
  36. }
  37. }
  38. getCoordinates(MonitorNumber){
  39. coord := 1920*MonitorNumber
  40. return coord
  41. }
  42. SetEnv file, C:\Users\SK\Documents\AutoHotKey\1.png
  43. setDisplay(MonitorNumber, CurrentSlideNumber){
  44. global
  45. coord := getCoordinates(MonitorNumber)
  46. SetEnv file, C:\Users\SK\Documents\AutoHotKey\%CurrentSlideNumber%.png
  47. ;file := "C:\Users\SK\Documents\AutoHotKey\" . %CurrentSlideNumber% . ".png"
  48. ;file := "C:\Users\SK\Documents\AutoHotKey\1.png"
  49. MsgBox %coord%,%MonitorNumber%,%CurrentSlideNumber%,%file%
  50. Gui, 1:destroy
  51. Gui, 1:+AlwaysOnTop +LastFound +Owner -Caption
  52. Gui, 1:Color, Black
  53. Gui, 1:Add, Picture, x0 y0 w%A_ScreenWidth% h-1 vPic, %file%
  54. Gui, 1:Show, x%coord% y0 maximize
  55. }