Changing the Current Zoom Value in Adobe Acrobat Topic is solved
-
- Posts: 348
- Joined: 27 Apr 2019, 17:38
Changing the Current Zoom Value in Adobe Acrobat
Adobe Acrobat displays the current page zoom percentage in a box at the top menu bar. Does anyone know how to use AutoHotkey to read the current zoom value inside that box and increase or decrease it by 10 when Numpad+ or - Numpad- is pressed? I think that the program may be able to read data from the box and then send another value.
- Attachments
-
- Untitled.png (16.39 KiB) Viewed 272 times
Re: Changing the Current Zoom Value in Adobe Acrobat Topic is solved
Code: Select all
incr := 10
#IfWinActive ahk_exe Acrobat.exe
NumpadAdd::
NumpadSub::
WinGet, cList, ControlList
For k, control in StrSplit(cList, "`n") {
If !Instr(control, "Edit")
Continue
ControlGetText, cText, %control%
If !Instr(cText, "%")
Continue
ControlSetText, %control%, % StrReplace(cText, "%") + (Instr(A_ThisHotkey, "Add") ? incr : -1 * incr)
ControlSend, %control%, {Enter}
Break
}
Return
#IfWinActive
-
- Posts: 348
- Joined: 27 Apr 2019, 17:38
Re: Changing the Current Zoom Value in Adobe Acrobat
Thank you for the script. It is now very convenient to change the zoom level. I can see that the script depends on finding the % character in order to identify the box where the zoom value is displayed.
Should the command WinGet, cList, ControlList be run every time when the hotkey is pressed, or should it be put at the top and thus run one time?
Should the command WinGet, cList, ControlList be run every time when the hotkey is pressed, or should it be put at the top and thus run one time?
Re: Changing the Current Zoom Value in Adobe Acrobat
Answer: try it!
It's a good question. It's possible that different Acrobat windows will have different control names; I seemed to encounter that in my testing. You could experiment and see what happens. My finding different values for the control names is what prompted me to get the list of controls.
Acrobat has its own hotkeys to zoom, of course. I assumed that you wanted a separate script because you want custom zoom levels rather than the standard ones that Acrobat provides. If you just want standard zoom levels, then you would not need this script. I actually do use a script like this for another PDF viewer that I use.
If you want to get super-detailed, you could store the specific control name for each Acrobat window, and then reuse that name instead of checking the list again for that same window. I did not bother with that, but you could if that improves how the routine works for you.
Enjoy!
It's a good question. It's possible that different Acrobat windows will have different control names; I seemed to encounter that in my testing. You could experiment and see what happens. My finding different values for the control names is what prompted me to get the list of controls.
Acrobat has its own hotkeys to zoom, of course. I assumed that you wanted a separate script because you want custom zoom levels rather than the standard ones that Acrobat provides. If you just want standard zoom levels, then you would not need this script. I actually do use a script like this for another PDF viewer that I use.
If you want to get super-detailed, you could store the specific control name for each Acrobat window, and then reuse that name instead of checking the list again for that same window. I did not bother with that, but you could if that improves how the routine works for you.
Enjoy!
-
- Posts: 348
- Joined: 27 Apr 2019, 17:38
Re: Changing the Current Zoom Value in Adobe Acrobat
Yes, I needed a custom incremental change of the zoom level, because the standard value is different. The script greatly simplifies the adjusting of the zoom level.
It is useful to get a list of controls every time, because this ensures that the commands will be executed as intended.
It is useful to get a list of controls every time, because this ensures that the commands will be executed as intended.
Who is online
Users browsing this forum: No registered users and 309 guests