1
For some reason this script doesn't go to the next empty cell in column?  

What am I doing wrong ? I would love to be able to add today's date to next empty cell in column and would be great if those numbers will not not change but stay at that date

need some help thanks in advance.

on run {input, parameters}
 
 tell application "Numbers"
  activate
  tell the first table of the active sheet of document 1
   tell column "F"
    set r to (address of row of last cell whose value is greater than "")
    set r to r + 1
    set value of cell r to date string of (current date)
   end tell
  end tell
 end tell
 
 
 return input
end run
Frank C.
  • 7,758
  • 4
  • 35
  • 45

1 Answers1

2

Here is code that I use to find the next empty cell in a column:

tell application "Numbers"
    tell front document
        tell table 1 of sheet 1
            set fullSheet to 1
            repeat
                set cellValue to value of cell ("A" & fullSheet) --of table 1 of sheet 1
                if cellValue = missing value then exit repeat
                set fullSheet to fullSheet + 1
            end repeat
        end tell
    end tell
end tell

I know it is not very glamorous, but it has continued to work through all of the Numbers upgrades since Feb 2014.

Craig Smith
  • 1,063
  • 2
  • 11
  • 21