アプリケーションを起動する
アプリケーションを起動するには次のようにコマンドを実行します。
osascript -e 'tell application "アプリケーション名" to run'
以下のコマンドを実行するとリマインダーが起動します。
osascript -e 'tell application "Reminders" to run'
次のように実行してもアプリケーションを起動できます。
こちらの場合には上記と違い、ウィンドウも表示されます。
osascript -e 'tell application "アプリケーション名" to activate'
以下のコマンドを実行するとリマインダーが起動し、ウィンドウが表示されます。
osascript -e 'tell application "Reminders" to activate'
また、次のコマンドもactivate
と同様の結果になります。
open -a 'アプリケーション名.app'
アプリケーションを終了する
アプリケーションを起動するには次のようにコマンドを実行します。
osascript -e 'tell application "アプリケーション名" to quit'
以下のコマンドを実行するとリマインダーが終了します。
osascript -e 'tell application "Reminders" to quit'