apple script 自动化

发布时间 2023-04-07 11:01:38作者: ploolq
#!/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"