在终端下执行AppleScript

AppleScript是一种OSA语言,偶然发现在Mac下有这样一组工具

osacompile 编译OSA文件
osadecompile  反编译OSA文件
osalang   列出已经安装的OSA语言
osascript 执行OSA语言

他们默认的是执行AppleScript,下面这句将打开iTunes并播放音乐:

osascript -e 'tell app "iTunes" to play'

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.