AppleScript名:2Dリスト内の要素をすべて加算 |
— Created 2017-10-01 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aList to {{1, 2, 3, 4, 5, 6, 4}, {1, 2, 3, 4, 5, 6}, {1, 2, 3, 4, 5, 16, 0, 0}} set aRes to getTotalValueFrom2DArray(aList) of me –> 77 –total value is 0 on getTotalValueFrom2DArray(aList) set anArray to current application’s NSArray’s arrayWithArray:aList set eRes to (anArray’s valueForKeyPath:"@unionOfArrays.self")’s valueForKeyPath:"@sum.self" return eRes as integer end getTotalValueFrom2DArray |
More from my site
(Visited 33 times, 1 visits today)