2D List(配列)のうち、最初の項目が指定キーワードではじまる要素をリストアップするAppleScriptです。
AppleScript名:指定キーワードで始まるリスト要素をリストアップ |
— Created 2017-05-2 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aList to {{"A1 uploading", 2, 2}, {"A2 loginAndDownload", 1, 1}, {"A11 selfCheck", 3, 1}} set bList to my fiter2DList:(aList) byHeadingKeyword:"A1" –> {"A1 TEST1", 2, 2} on fiter2DList:(pathList as list) byHeadingKeyword:(keyWord as string) set keyWord2 to keyWord & " " –ここが重要 set itemCount1 to count every item of pathList set tmpArray to current application’s NSMutableArray’s arrayWithArray:pathList –指定キーワードで始まるファイルをリストアップ set thePred2 to current application’s NSPredicate’s predicateWithFormat_("self[0] BEGINSWITH %@", keyWord2) set bArray to (tmpArray’s filteredArrayUsingPredicate:thePred2) as list of string or string if bArray = {} then return false return bArray end fiter2DList:byHeadingKeyword: |
More from my site
(Visited 49 times, 1 visits today)