在AppleScript中:
set allItems to every item whose name is "foo"
在rb-appscript中:
all_items = items[its.name.eq "Foo"]
有没有办法在MacRuby / ScriptingBridge中构建类似的搜索/谓词/你有什么?
答案 0 :(得分:0)
问题:解决了!
predicate = NSPredicate.predicateWithFormat %(name = "Foo")
all_items = items.filterUsingPredicate(predicate)