apple script 自动化

#!/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"

posted @ 2023-04-07 10:56  fndefbwefsowpvqfx  阅读(16)  评论(0编辑  收藏  举报