AppleScript名:リスト項目のシャッフル(ASOC) |
— Created 2016-12-06 by Takaaki Naganoya — 2016 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" use framework "ArrayRandomize" –https://github.com/masakihirokawa/objc-classes-dc-randomize –http://piyocast.com/as/archives/4351 –配列をシャッフルして取得 set anArray to current application’s NSMutableArray’s alloc()’s initWithArray:{1, 2, 3, 4, 5} set bArray to (current application’s DCRandomize’s shuffleArray:anArray) as list –> {5, 3, 1, 2, 4} –1〜10の数値をシャッフルして配列取得 set cArray to (current application’s DCRandomize’s shuffle:1 max:10) as list –> {9, 4, 6, 5, 3, 2, 7, 8, 1, 10} –5〜10の範囲の乱数を取得 set dArray to (current application’s DCRandomize’s range:5 max:10) as integer –> 7 –5〜10の範囲で 9以外の乱数を取得 set eArray to (current application’s DCRandomize’s exact:5 max:10 exceptId:9) –> 9 |
More from my site
(Visited 77 times, 1 visits today)