The script aims to replicate a Windows-like behavior for clicking on dock icons in macOS.
When one (1) app Window:
When an app is open but minimized, clicking its dock icon will unminimize and bring the app window to the front (native in both macOS and Windows).
When an app is open, frontmost and not minimized, clicking its dock icon will minimize the app window (native only in Windows).
When an app is open but not frontmost, clicking it's dock icon will bring the latest app window to front (native in both macOS and Windows).
When an app is not open, clicking its dock icon will launch the app (native in both macOS and Windows).
When more than one (1) app Window:
For apps with multiple windows open, clicking the dock icon bring last window to the front.
This behavior is not native to macOS. By default on Mac, clicking a dock icon of a minimized app does not unminimize it, it's unhidden. The script aims to make the dock behavior more similar to the Windows taskbar, where a single click toggles the window state with the Minimize action.
Hey! Was looking for something like that for quite some time. But I see, you just recently created this script, so got lucky.... Two things, where it is not working is - when you have multiple windows open for same app. When clicking icon it is not minimizing window.... As well as not un-minimizing app at all, have to right click to get it to work. And other one - weirdly if, lets say, you close all app windows by X and app is still open (when having dot under app icon on dock), script is not opening app at all. When you click icon, it does nothing. So have to quit app for good and open again. Wonder if it is something fixable.... Anyways, Thanks for the script!
P.S When importing the script, why it has two duplicate entries @ BTT? Have to disable/delete one in order to avoid getting mini menu to choose which script to run when doing left click ...
Hi Andreas, thanks for implementing this as it is very handy.
I can't get it to work however. I will admit, I am not a BTT pro but I do have another existing preset that is working.
When I import your preset I get a warning about a duplicate preset and then it imports it.
Everything seems to be set up but I don't see the expected behaviour when clicking on any Dock icon twice.
Some help would be really appreciated, thanks.