AppleScript名:数値リストで指定数よりも大きな要素のみを抽出 |
— Created 2017-10-29 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aList to {8, 2, 7, 3, 9, 1, 6, 4} set theArray to current application’s NSArray’s arrayWithArray:aList set thePred to current application’s NSPredicate’s predicateWithFormat:"self >= 4" set bList to (theArray’s filteredArrayUsingPredicate:thePred) as list –> {8, 7, 9, 6, 4} set thePred to current application’s NSPredicate’s predicateWithFormat:"self > 4" set cList to (theArray’s filteredArrayUsingPredicate:thePred) as list –> {8, 7, 9, 6} |
More from my site
(Visited 17 times, 1 visits today)