AppleScript名:配列の指定要素を削除する |
— Created 2017-10-29 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" –Chapter 6 Lib.asobjcex3doc set theList to {5, 2, 9, 4, 2, 6, 3} set bList to my deleteItem:2 fromList:theList –> {5, 9, 4, 6, 3} set cList to deleteItem of me by 2 from theList –> {5, 9, 4, 6, 3} set dList to deleteItemBy(2, theList) of me –> {5, 9, 4, 6, 3} –Objective-Cライクなパラメータ記述 on deleteItem:anItem fromList:theList set theArray to current application’s NSMutableArray’s arrayWithArray:theList theArray’s removeObject:anItem return theArray as list end deleteItem:fromList: –無意味句による装飾 on deleteItem by anItem from theList set aRes to my deleteItem:anItem fromList:theList return aRes end deleteItem –Pure AS風のパラメータ記述 on deleteItemBy(anItem, theList) set aRes to my deleteItem:anItem fromList:theList return aRes end deleteItemBy |
More from my site
(Visited 194 times, 1 visits today)