repeat ~ end repeat
準備
tell application "Numbers" activate set tgtDoc to make new document tell tgtDoc set tgtSheet to sheet 1 tell tgtSheet delete every table set tgtTable to make new table with properties {row count:10, column count:10, header row count:0, header column count:0} tell tgtTable set height of every row to 36 set width of every column to 36 -- HERE INSERT CODE (see article below) end tell end tell end tell end tell
repeat構文を用いて各セルにcell indexを入れる.
- count of cellsで全セル数を取得できる.
- cell indexでのcell 1は,cell "A1",cell 2はcell "B1"に相当する.
repeat with i from 1 to (count of cells) set value of cell i to (i as number) end repeat
各セルにcell nameを入れる.
- applescriptのナンバーズの"用語説明"の"cell"にはnameがない.
- しかし,"cell name" で "A1" のようにcell nameが取得できる.
repeat with i from 1 to (count of cells) set value of cell i to (name of cell i) end repeat
[1] https://iworkautomation.com/numbers/range.html AppleScript and Numbers: Ranges https://excel-ubara.com/excelvba1/