Skip to content

Instantly share code, notes, and snippets.

@externvoid
Last active June 26, 2019 05:19
Show Gist options
  • Save externvoid/1ed87dda76ac65b947a30ff467ef89d8 to your computer and use it in GitHub Desktop.
Save externvoid/1ed87dda76ac65b947a30ff467ef89d8 to your computer and use it in GitHub Desktop.
AppleScriptやってみる

変数と代入とリスト

set ABC to "OK"
-- => あいうえお
item 1 of {"あいうえお", 123, ABC}

json(レコード)も扱える

set ABC to "OK"
set x to item 1 of {"あいうえお", 123, ABC}
set y to SUJI of {AIUEO:"あいうえお", SUJI:123, HENSU:ABC}
x
-- => "OK123"
ABC & y as string

シェルスクリプトを動かしたり、ファイルパスを受け取ったり

  1. シェルコマンドを実行 AppleScript でターミナルを操作する

  2. ファイルパスの取得 AppleScriptでファイルやフォルダを取得する

  3. 公式リファレンス POSIXと検索すると!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment