osascript 是什么
man osascript
osascript -- execute OSA scripts (AppleScript, JavaScript, etc.)
常用
osascript -e 'return "hello"'
osascript -e 'get the clipboard'
显示通知
osascript -e ' display notification "通知内容" with title "标题" subtitle "子标题" '
osascript -e 'tell Application "Finder" to display dialog "Job finished" '
显示系统信息
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
https://qiita.com/satosystems/items/8fff5b2313ecd6f81af3
https://shuzo-kino.hateblo.jp/entry/2015/01/03/234722
http://www.asahi-net.or.jp/~va5n-okmt/factory/applescript/sample_code/