AppleScript 繰り返しであるfor文を使用するサンプル

環境
macOS 11.6

書式

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
set 変数 to {1, 2, 3,....}
repeat with i in 変数
i
end repeat
set 変数 to {1, 2, 3,....} repeat with i in 変数 i end repeat
set 変数 to {1, 2, 3,....} 

repeat with i in 変数
      i
end repeat

ファイル名:data.scpt
サンプルコード

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
set ns to {11, 32, 43}
repeat with i in ns
i
end repeat
set ns to {11, 32, 43} repeat with i in ns i end repeat
set ns to {11, 32, 43}

repeat with i in ns
      i
end repeat

実行結果
osascript data.scpt

AppleScript

Posted by arkgame