AppleScript名:NSRangeの基礎的な処理 |
— Created 2017-12-12 by Takaaki Naganoya — 2017 Piyomaru Software use AppleScript version "2.4" use scripting additions use framework "Foundation" set aRange to current application’s NSMakeRange(0, 100) –> {location:0, length:100} set maxRange to current application’s NSMaxRange(aRange) –最大値 –> 100 set rangeStr to (current application’s NSStringFromRange(aRange)) as string –> "{0, 100}" set bRange to current application’s NSRangeFromString(rangeStr) –> {location:0, length:100} set cRange to current application’s NSMakeRange(50, 80) set cRes to current application’s NSEqualRanges(aRange, cRange) –> false set dRes to current application’s NSEqualRanges(aRange, bRange) –> true set eRes to current application’s NSIntersectionRange(aRange, cRange) –> {location:50, length:50} set fRes to current application’s NSLocationInRange(50, aRange) –> true set gRes to current application’s NSLocationInRange(120, aRange) –> false set hRes to current application’s NSUnionRange(aRange, cRange) –> {location:0, length:130} |
More from my site
(Visited 24 times, 1 visits today)