osascript是什么
man osascript
osascript -- execute OSA scripts (AppleScript, JavaScript, etc.)
显示桌面通知
osascript -e ' display notification "通知内容" with title "标题" subtitle "子标题" '
显示系统信息
osascript -e "system info"
osascript -e "IPv4 address of (system info)"
osascript -e "CPU type of (system info)"
# Intel x86-64h Haswell
其他
osascript -e "set volume 0"
osascript -e "beep 2"
osascript -e 'display dialog "Did you know that you are annoying?" buttons "Yes" with icon note'
osascript -e 'delay 0.5 '
参考:
https://sspai.com/post/43758
https://sspai.com/post/46912
https://www.jianshu.com/p/d42dff738d70
https://segmentfault.com/a/1190000011273388
https://github.com/linjunpop/imessage/blob/c026cd9011b3b5ba99687c3dcf13957da6137bac/lib/imessage/sender.rb#L51
https://apple.stackexchange.com/questions/103621/run-applescript-from-bash-script