setting intial value of NSstepper in Awake from nib

I don’t suppose any one knows how to set the initial value of a stepper button?

I’ve tried the obvious…

on awake from nib theObject
if name of theObject is “MyStepper” then
set value of theObject to 5
end if
end awake from nib

This produces the error "Can’t make value of <> id 8 of window id 3 into type reference. (-1700)

I know the initial value is generally set in the inspector window under the attributes pane but I’m getting this value from a prefs file that may be different each time the app launches so I need to be able to change the initial value at launch time.

Hi PolarBear,

I think the problem of your script is ‘set value of …’. Try using ‘set integer value of …’, ‘set double value of …’ or ‘set float value of …’ depending on what kind of number you want to set.

D.

Stop writing glue code for your interface preferences. :wink:

http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html

I like Glue code. Glue code is fun for mentals. Glue code is our friend. :wink:

That did the trick Dominik. Thanx a bunch. I wouldn’t have thought of that. :smiley: