applescript
差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン前のリビジョン次のリビジョン | 前のリビジョン | ||
applescript [2022/11/22 00:56] – nullpon | applescript [2024/05/05 16:32] (現在) – nullpon | ||
---|---|---|---|
行 70: | 行 70: | ||
error number -128 | error number -128 | ||
</ | </ | ||
+ | |||
+ | ===== TerminalからAppleScriptを呼び出す ===== | ||
+ | |||
+ | osacriptコマンドで呼び出すことができる | ||
+ | |||
+ | < | ||
+ | / | ||
+ | </ | ||
+ | |||
+ | シェルスクリプトとして呼ぶことも可能 | ||
+ | |||
+ | <code applescript> | ||
+ | # | ||
+ | |||
+ | on run argv | ||
+ | set msg to " | ||
+ | |||
+ | if (count of argv) > 0 then | ||
+ | set msg to (item 1 of argv) | ||
+ | end if | ||
+ | |||
+ | display notification msg with title "From Terminal" | ||
+ | end run | ||
+ | </ | ||
+ | |||
+ | これをnotifyなどと名前をつけて保存し、実行権限を付与すると通知センターに任意のメッセージを表示するコマンドになる。 | ||
+ | |||
+ | < | ||
+ | ./notify 任意のメッセージ | ||
+ | </ | ||
+ | |||
+ | ''/ | ||
+ | |||
+ | |||
applescript.1669078585.txt.gz · 最終更新: 2022/11/22 00:56 by nullpon