首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >AppleScript -如何循环遍历列并基于数字中的现有值更改值

AppleScript -如何循环遍历列并基于数字中的现有值更改值
EN

Stack Overflow用户
提问于 2019-12-03 05:48:16
回答 1查看 421关注 0票数 1

我是AppleScript的新手,不知道如何从上到下遍历数字电子表格列(本例中为"C“列),并根据其现有值更改其值。我已经在网上找过了,但没有成功。

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

代码语言:javascript
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-03 06:15:47

你遗漏了:of column "C"

您需要更改:

代码语言:javascript
复制
if value of cell i is equal to "National League" then

至:

代码语言:javascript
复制
if value of cell i of column "C" is equal to "National League" then
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59147140

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档