Cocoaの配列(NSArray)を逆順に並びかえるAppleScriptです。
普通のAppleScriptのlist型変数であれば、reverse ofで逆順に並び替えられますが、Cocoaの配列だとこんな感じです。
AppleScript名:配列を逆順に(ASOC) |
— Created 2017-07-30 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} set anArray to current application’s NSMutableArray’s arrayWithArray:aList set revArray to (anArray’s reverseObjectEnumerator()’s allObjects()) as list –> {6, 5, 4, 3, 2, 1} |
More from my site
(Visited 22 times, 1 visits today)