El diccionario AppleScript Numbers tiene información sobre solo células, y un gama de células. Me gustaría especificar celdas individuales, no contiguas.
Mi ejemplo funciona, pero la repetición de líneas como ésta me molesta. ¿Existe una solución sencilla y más elegante/eficiente? ¿Pueden ir los nombres/números de las celdas en una lista? ¿Cuál sería la sintaxis?
Todos ellos dan varios errores:
set the background color of cell "A1" and "A5" to cellColour
set the background color of cell "A1" & "A5" to cellColour
set the background color of cell {“A1”, "A5”} to cellColour
set the background color of cell {“A1:A5”} to cellColour
set the background color of cell {A1:A5} to cellColour
set the background color of cell (A1,A5) to cellColour
set the background color of cells {A1,A5} to cellColour
Mi script:
-- Opens a Numbers spreadsheet, then sets non contiguous cells' background colour
set cellColour to {0, 0, 0}
tell application "Numbers"
activate
if not (exists document 1) then make new document
tell the front document
tell active sheet
set thisTable to ¬
make new table with properties ¬
{row count:5, column count:3}
tell thisTable
set the width of every column to 30
set the height of every row to 30
-- make all cells white first
repeat with i from 1 to the count of cells
set the background color of cell i to {65535, 65535, 65535}
end repeat
set the background color of cell "A1" to cellColour
set the background color of cell "A5" to cellColour
set the background color of cell "B2" to cellColour
set the background color of cell "C4" to cellColour
end tell
end tell
end tell
end tell
Gracias de antemano :-)