以下の内容はhttps://shuzo-kino.hateblo.jp/entry/2015/01/03/234722より取得しました。


osascriptでOS Xのアプリを操作する

osascriptコマンドは

osascript -- execute AppleScripts and other OSA language scripts

とあるように、AppleScriptというOS Xアプリケーションを操作するスクリプトを実行するコマンドです。

そのまんま使う事も可能ですし、

$ osascript -e 'return "hello"'

クリップボードの中身をみたりもできます。

$ osascript -e 'get the clipboard'

"hello"

が、アプリケーションと連動する事で真価を発揮します。
たとえば、

$ osascript -e 'tell Application "Finder" to display dialog "Job finished" '

とやると、Finderが
f:id:shuzo_kino:20150103233020p:plain
というポップアップを出してくれます。
パイプでつなぐ事もできるため、長めな処理を終えてFinderを表示…なんて用途にも使えそうです。

参考もと




以上の内容はhttps://shuzo-kino.hateblo.jp/entry/2015/01/03/234722より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14