macos神器osascript

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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 作为一个前端程序猿,下面这些站会让你眼前一亮。 amazeui框架组建丰富 http://amazeui.org...
    欧巴冰冰阅读 8,942评论 18 303
  • 前端知识体系http://www.cnblogs.com/sb19871023/p/3894452.html 前端...
    秋风喵阅读 12,638评论 7 163
  • 大部分的后端会很很鄙视前端。我也不知道为什么,可能大部分人都会觉得脚本语言根本不算语言。 大多人 会叫我们切图仔,...
    小黑的眼阅读 3,491评论 0 15
  • 35岁之前,我们过的是别人要我们过的生活;35岁之后我们过的是属于自己的生活。 站在35岁的门槛,回顾过去,憧憬未...
    秀红说阅读 742评论 1 4
  • 烟台生来便不懂得浪漫,他睡的太早,又起的太晚,不顾自行车的车轮划开阳光的璀璨,兀自的不紧不慢,也别指望他陪你...
    南山北盗阅读 346评论 0 2