[boolValue] as booleanを使わない場合
property refMe : a reference to current application
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
-->false
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
-->true
set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue
-->false
set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s boolValue
-->true
set ocidTrue to (refMe's NSNumber's numberWithBool:false)'s integerValue
-->0
set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s integerValue
-->1
#!/usr/bin/env osascript
use AppleScript version "2.8"
use framework "Foundation"
use scripting additions
property refMe : a reference to current application
set ocidFalse to (refMe's NSNumber's numberWithBool:false)
-->false
set ocidTrue to (refMe's NSNumber's numberWithBool:true)
-->true
set ocidFalse to (refMe's NSNumber's numberWithBool:false)'s boolValue
-->false
set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s boolValue
-->true
set ocidTrue to (refMe's NSNumber's numberWithBool:false)'s integerValue
-->0
set ocidTrue to (refMe's NSNumber's numberWithBool:true)'s integerValue
-->1
| 固定リンク
「NSNumber」カテゴリの記事
- NSNumberのValueの考え方(2024.09.03)
- [AppleScript]負の数値を整数にする(2024.09.02)
- [NSDecimalNumber]計算にNSDecimalNumberを使う(2024.03.26)
- [小数点]小数点いかの桁揃え(2023.11.13)
- [integerValue]as integerを使わない場合(2023.01.12)