applescript
文書の過去の版を表示しています。
AppleScript
サンプル
iTermを立ち上げて、docker-composeを起動する
tell application "iTerm" activate set _targetWindow to current window if _targetWindow is null then set _targetWindow to create window with default profile end if tell current session of _targetWindow write text "cd ~/Documents/hoge" write text "docker-compose -d up" end tell end tell
アラート
display alert "アラート"
確認ダイアログ
display dialog "続ける?"
デフォルトはOKとキャンセルボタン。キャンセルを選ぶとスクリプト実行が打ち切られる
display dialog "どれ?" buttons {"A", "B", "C"} set ans to button returned of result
buttonsでボタンの中身を変更できる。button returned of resultで選択したボタンのラベルが取得できる
display dialog "どれ?" buttons {"A", "B", "C"} default button "A" cancel button "C"
default buttonでデフォルトボタンを指定。cancel buttonでキャンセルボタンを指定(選択するとスクリプト実行が打ち切られる)
キャンセル
途中で処理をキャンセル (エラーコード-128はユーザによるキャンセル扱い)
error number -128
applescript.1561016944.txt.gz · 最終更新: 2019/06/20 07:49 by nullpon