I’m unable to get this function to work. The if always return false. What i’m doing wrong?
This come from a cocoa checkbox, the OverrideBuildCheked is 1 when checked and 0 when unchecked.
on OverRideBuildNumber_(sender)
set OverrideBuildCheked to CurrentBuildOverrideChk's state
if OverrideBuildCheked = 1 then
CurrentBuildField's setEnabled_(true)
CurrentBuildField's setEditable_(false)
else
CurrentBuildField's setEnabled_(false)
CurrentBuildField's setEditable_(true)
end if
end OverRideBuildNumber_
Just about everything from Cocoa is a pointer to an object (you can see this by logging the result), so you usually need to coerce to the desired AppleScript class, e.g. CurrentBuildOverrideChk’s state as integer (or boolean).