如何在ApplescriptObjC中获取滑块的值?

时间:2014-11-03 13:42:37

标签: applescript applescript-objc

property slider : missing value if slider's integerValue = 5 then -- Do something end if

此代码无法运行。有什么想法吗?

1 个答案:

答案 0 :(得分:1)

log class of slider's integerValue会返回名为__NSCFNumber

的内容

log class of 5返回<NSAppleEventDescriptor: 'long'>

看起来Applescript不会自动为您转换值。为了让它工作(奇怪的)转换将会这样做:

if slider's integerValue as integer = 5 then
    -- Do something
end if

问候,迈克尔/汉堡