AppleScript 関数を作成する方法

環境
macOS 11.6
構文
on 関数名(引数)
処理コード
end f
関数名(引数)
操作例
ファイル名 cft.scpt
サンプルコード
Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
on funA(x,y)
x + y
end funA
funA(6,2)
on funA(x,y) x + y end funA funA(6,2)
on funA(x,y)
      x + y
end funA

funA(6,2)

実行結果
osascript cft.scpt

実行結果
8

AppleScript

Posted by arkgame