I would like to be able to resize the Dock in macOS strictly using keybindings. Ideally, this would be incrementally and work similar to the way that volume/brightness increase/decrease keys work.
I use BetterTouchTool for most of my gesture/shortcut customizations, and I have been able to achieve just about everything I've needed with it, but this is one thing I've yet to figure out.
Has anyone ever successfully achieved this? If so, what was your approach (software, tools, etc.)?
Best Answer
The approach I ended up taking was a variation of @Paolo's solution, and is simple to implement using a tool like BetterTouchTool (as @blizzrdof77 mentions in his original question).
Instead of preparing two AppleScripts, this single script takes one argument - a numeric value between
-1.5
and1.5
- which determines whether the dock will increase or decrease in size.The AppleScript:
Create a new file called
"change-dock-size.applescript"
with the following content:Running It From The Command Line:
You can run this from the command line using
osascript
- like this:# Increase Dock Size
osascript /path/to/script/change-dock-size.applescript 0.01
# Decrease Dock Size
osascript /path/to/script/change-dock-size.applescript -0.01
Adding Keybindings to BetterTouchTool:
To use this in BTT, add two new shortcuts with the "Execute Terminal Command" action, and use the above examples as the commands (I've provided a screenshot of my setup below). I hope this helps!