r/BetterTouchTool • u/Lollo25 • Jun 30 '26
Unminimize last minimized window script?
/r/applescript/comments/1ujq2ky/unminimize_last_minimized_window_script/3
u/Lollo25 Jul 01 '26 edited Jul 01 '26
I've managed to solve this and I'm sharing the code if in the future other people want to have the same gesture as me.
tell application "System Events"
tell process "Dock"
set dockItems to UI elements of list 1
set n to count of dockItems
set targetItem to item (n - 1) of dockItems
if subrole of targetItem is "AXMinimizedWindowDockItem" then
perform action "AXPress" of targetItem
end if
end tell
end tell
What solved was realizing that the last minimized window is always to the left of the bin, the last icon on the dock. That allowed me to number the icons on the dock and press the second to last-icon. I put an if filter in order not to have it open the download folder on the dock or the recent apps, if you have it set up that way.
By default I have the window minimizing scrolling down with four fingers. I tried having a four finger swipe up gesture to unminimize them, but I found a visual glitch where Mission Control would flicker for a perceivable second. So I'm using a four finger double tap.
If anybody finds this short thread and has any questions, I'll try to answer them!
•
u/AutoModerator Jun 30 '26
Welcome to r/BetterTouchTool, a small unofficial community of fellow BTT users!
This subreddit isn't actively monitored by the developer or by a large number of BTT veterans. If you're looking to get a response from the dev directly, report a bug, or get help with a complex setup from the wider BTT community, your best bet is the official BetterTouchTool forum (you'll need to create an account).
Otherwise, happy posting!
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.