#!/bin/bash
osascript <<EOD
tell application "Finder"
if (get count of windows) ≥ 3 then
activate
set visible to true
activate
else
make new Finder window to home
activate
set visible to true
activate
end if
end tell
tell application "System Events" to tell process "Finder"
activate
delay 0.4
tell menu bar item "Window" of menu bar 1
click
click menu item "Bring All to Front" of menu 1
end tell
end tell
display notification "HK" with title "Action performed" subtitle "Show Finder." sound name "Purr"
![](https://img2023.cnblogs.com/blog/859364/202304/859364-20230407105616818-353924321.png)
![](https://img2023.cnblogs.com/blog/859364/202304/859364-20230407105628366-1701199208.png)