I have a need to toggle the user interface scaling between Small and Medium fairly frequently in InDesign (2025 currently), but I'm having some trouble getting it to work with either or both AppleScript and KM actions. Can anyone offer a solution?
Here's the UI Sizing slider in Preferences > User Interface Scaling. There doesn't seem to be an AppleScript way to control that slider. The slider can't be tabbed to or selected (via Click at Found Image) and then moved with keyboard arrows.
I don't have InDesign, but I don't see why you can't click use KM to "click and drag" the slider.
Are there only five positions that the slider can be positioned at, (which is what I think I see in your screenshot) or are there hundreds of possible positions? Or may I assume that there are only two values for UI Sizing when you are running InDesign, "Small" (0%) and "Medium" (50%)? That would be helpful for solving this.
Adobe like to roll their own dialogs, in the name of "cross-platform consistency". And they usually omit the Accessibility properties System Events relies on.
Do you even need it? In the spirit of TMTOWTDI (and not because it's any better!)...
You're toggling between two states -- you can look for either image and click in the middle of whichever you find. And with a bit of careful screenshotting the "middle" will be the place you want to click to change the setting...
I did find I needed to click twice to get it to register (this machine's running ID 2024, though) -- and I've left the "relaunch" confirmation out:
Ultimately, I went the click-and-drag route withing a toggle macro: If InDesign is in Small sizing, make it Medium; if UI Sizing is Medium, make it Small.
Umm, you don't even need an IF statement or any toggle logic. You just attempt to drag the button both ways. If it doesn't find the button, it aborts (without an error message.) It only takes two simple Mouse actions to accomplish what you want.
You do need the two conditions because the button itself changes size with the rest of the UI. So do the scale, OK button, and the rest of the Preferences dialog. The Found image action needs the screenshots of each to register which action to perform--dragging left or dragging right.