AppleScript名:1D List中のアイテムが指定リストに入っていたら抽出 |
— Created 2017-11-03 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" property NSPredicate : a reference to current application’s NSPredicate property NSArray : a reference to current application’s NSArray set aList to {"Apple", "Lemon", "Apple", "Water Melon"} set aTarg to {"Apple", "Lemon"} –データの表記ゆらぎ対策に使える? set anArray to NSArray’s arrayWithArray:aList set aPred to NSPredicate’s predicateWithFormat_("SELF IN %@", aTarg) set bRes to (anArray’s filteredArrayUsingPredicate:aPred) as list –> {"Apple", "Lemon", "Apple"} |
More from my site
(Visited 20 times, 1 visits today)