AppleScript - 如何循环通过列并根据 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

最新更新