AppleScript名:2Dリストから、指定カラムのデータを削除する v3 |
— Created 2017-11-25 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" –http://piyocast.com/as/archives/5000 set aList to {{1, 2, 3}, {2, 3, 4}, {3, 4, 5}} set removeIndex to 3 –1 based index set bList to removeColumnFrom2DArray(aList, removeIndex) of me –> {{1, 2}, {2, 3}, {3, 4}} on removeColumnFrom2DArray(aList as list, removeIndex as integer) set newArray to {} set realIndex to removeIndex – 1 –index conversion from 1-based to 0-based repeat with i in aList set anArray to (current application’s NSMutableArray’s arrayWithArray:i) (anArray’s removeObjectAtIndex:realIndex) set the end of newArray to anArray as list of string or string –as anything end repeat return newArray end removeColumnFrom2DArray |
More from my site
(Visited 18 times, 1 visits today)