TRaP
Moderator
Inregistrat: acum 7 ani
Postari: 822
|
|
A tad more complicated code that ensures the input box stays open when pressing OK and navigating, so that you can use it without having to press CTRL+G every time. The input box closes when Cancel or X is pressed.
#IfWinActive ahk_class PPTFrameClass ^G:: GoSub, ShowInputBox return
ShowInputBox: Gui, New, +AlwaysOnTop +HwndMyGuiHwnd, Go to Slide Number Gui, Add, Text,, Please enter a slide number: Gui, Add, Edit, vSlideInput w200 Gui, Add, Button, x10 y+10 w80 gSubmitSlide Default, OK ; Gui, Add, Button, Default gSubmitSlide, OK Gui, Add, Button, x+10 yp w80 gCancelInputBox, Cancel ; Gui, Add, Button, gCancelInputBox, Cancel Gui, Show,, Go to Slide Number return
SubmitSlide: Gui, Submit if (SlideInput = "") { MsgBox, 48, Input Needed, Please enter a slide number. return } Gui, Destroy
; Re-activate PowerPoint before sending keystrokes WinActivate, ahk_class PPTFrameClass Sleep, 200
; Jump to the slide via Slideshow mode and then exit Send, {F5} Sleep, 200 Send, %SlideInput% Send, {Enter} Sleep, 300 Send, {Esc} return
CancelInputBox: Gui, Destroy return |
Source: ChatGPT
|
|