1

在小程序中:

set allItems to every item whose name is "foo"

在 rb-appscript 中:

all_items = items[its.name.eq "Foo"]

有没有办法在 MacRuby/ScriptingBridge 中构建类似的搜索/谓词/what-have-you?

4

1 回答 1

0

问题解决了!

predicate = NSPredicate.predicateWithFormat %(name = "Foo")
all_items = items.filterUsingPredicate(predicate)

方便参考

于 2013-02-04T05:35:36.007 回答