r/applescript • u/sbdbst • Aug 11 '22
Using Applescript to change screen zoom accessibility preferences
Hi, I am visually impaired and completely new to Applescript and use the screen zoom 99% of the time I interact with any app. A sub-setting within screen zoom is "follow focus", where the zoom tracks the cursor while typing so I can keep both hands on the keyboard while typing. However, when watching YouTube (or any video player) I zoom in so that the player fits the screen, it makes the player controls bigger (rather than doing full screen). But if I use any of the arrow keys or numbers to skip forward or back or change volume, my follow focus shifts to random parts of the screen and I need to use the mouse to realign manually each time I touch any key.
Is there a way to create a script to toggle "follow focus (when typing)" on or off?
Mac OS Monterey 12.5
The path to the preference I want to change:
System Preferences > Accessibility > Zoom > Advanced... > Follow Focus (tab) > Follow keyboard focus (dropdown menu)
Ideally, I'd like to be able to toggle the setting between "Never" and "when typing" with a shortcut but I have no idea where to start or if this is even possible.
Any guidance or pointers will be much appreciated, thanks.
View all comments
Show parent comment
2
u/Xane256 Aug 11 '22
By you might be able (with some additional software) to rebind the volume keys to do 3 actions each time you press the key: turn the toggle off, do the default behavior, then turn the toggle on again. If you go into your keyboard system preferences and change the row to be standard function keys, then the volume button is now F11/F12 instead. You can also hold Fn while pressing any of them to get the old behavior.
On a side note I have two tips: