在小程序中:
set allItems to every item whose name is "foo"
在 rb-appscript 中:
all_items = items[its.name.eq "Foo"]
有没有办法在 MacRuby/ScriptingBridge 中构建类似的搜索/谓词/what-have-you?
在小程序中:
set allItems to every item whose name is "foo"
在 rb-appscript 中:
all_items = items[its.name.eq "Foo"]
有没有办法在 MacRuby/ScriptingBridge 中构建类似的搜索/谓词/what-have-you?
问题解决了!
predicate = NSPredicate.predicateWithFormat %(name = "Foo")
all_items = items.filterUsingPredicate(predicate)
方便参考。