如何将动词应用于AppleScript引用中的每个项?(特别是Microsoft Excel)

如何将动词应用于AppleScript引用中的每个项?(特别是Microsoft Excel),applescript,Applescript,在MicrosoftExcel中,我试图使用AppleScript隐藏一组与简单查询匹配的行:如果F列的值为0.0。我让它工作,但脚本必须循环通过每个匹配来隐藏它,这比我希望的要慢,也不那么优雅: tell application "Microsoft Excel" tell used range of active sheet of active workbook set row_references to ((every row whose value of cell

在MicrosoftExcel中,我试图使用AppleScript隐藏一组与简单查询匹配的行:如果F列的值为0.0。我让它工作,但脚本必须循环通过每个匹配来隐藏它,这比我希望的要慢,也不那么优雅:

tell application "Microsoft Excel"
    tell used range of active sheet of active workbook
        set row_references to ((every row whose value of cell 6 is 0.0))
        repeat with current_row in row_references
            set hidden of entire row of current_row to true
        end repeat
    end tell
end tell
我真正想要的是,如果我可以使用一个Apple事件隐藏每一行:

tell application "Microsoft Excel"
    tell used range of active sheet of active workbook
        set hidden of (entire row of (every row whose value of cell 6 is 0.0)) to true
    end tell
end tell
…但这会引发错误:无法将单元格6=0.0的活动工作簿的活动工作表的“已使用范围”的每一行的整行隐藏设置为true

如果我使用删除动词,我可以做一些接近我所追求的事情:

tell application "Microsoft Excel"
    tell used range of active sheet of active workbook
        delete (every row whose value of cell 6 is 0.0)
    end tell
end tell
这只是一次性删除所有匹配的行,不需要循环

请注意,在前两个示例中,我必须使用整行引用,因为只有将整行或整列指定为范围时,隐藏属性才会起作用。delete命令没有此要求

所以我的问题是:我想做的是可能的吗?为什么delete动词可以毫无问题地工作,但它似乎不喜欢set


谢谢。

有些应用程序比其他应用程序更擅长评估复杂的查询。Word和Excel的结局不太好。我想你可能不得不接受这个循环。很有趣,也很有意义。感谢@foo的回复,很高兴知道我并没有遗漏一些明显的东西。我不知道答案,但失败的东西会使用整个。。。工作的人使用每一个。。。。这两条语句可能返回不同的对象类型。