I want to find how many rows are being used in a Number spreadsheet. I have a script for Excel which includes
set numRows to name of first row of (find cell of range "A:A" what "")
I seem to have to count ‘manually’ with Numbers, so it must be an easy bit of AppleScript to test each cell in a column and see if its empty, then report the number of tests made (the number of rows).
Numbers doesn’t appear to have empty cells so I’m assuming I need to find the first cell in a column which contains “0.0”.
tell application "Numbers"
tell table 1 of sheet 1 of document 1
repeat with n from 1 to row count
if value of cell 1 of row n of column 1 is "0.0" then
return n
end if
end repeat
end tell
end tell
I can see the script get the value of the cells, the first dozen and not “0.0”, but it carries on because I’ve not worked out how to stop the script at the first blank cell.
Sorry its a basic question which I should really know…
Thanks!