AppleScript - 如何循环遍历列并根据 Numbers 中的现有值更改值

AppleScript - How to loop thru column and change vaules based on existing value in Numbers

我是 AppleScript 的新手,无法弄清楚如何循环遍历 Numbers 电子表格列,在本例中为 "C" 列,从上到下并根据其现有值更改其值。我在网上看过,但没有成功。

这是我目前所拥有的,但它不起作用。它只会更改单元格 C11 中的值。

on run {input, parameters}

    tell application "Numbers"
        activate
        tell the first table of the active sheet of document 1
            repeat with i from 2 to count of cells of column "c"
                if value of cell i is equal to "National League" then
                    set the value of cell i of column "C" to "2"
                end if
            end repeat
        end tell    
    end tell

    return input
end run

您遗漏了:of column "C"

您需要更改:

if value of cell i is equal to "National League" then

收件人:

if value of cell i of column "C" is equal to "National League" then