Getting a sliders current value?

I’ve been banging my head against this one all morning. I’ve got a horizontal slider in a window in my apllescript cocoa app and I’ve given it an applescript name and connected it to my applescript with on action and in my applscript in the on action handler I have the following:

on action theObject if name of theObject is "MySlidersApplescriptName" then set MyVariable to value of theObject end if end action
that throws a coersion failure error -1700

I tried set MyVariable to current value …

won’t compile,

tried currentvalue

treats currentvalue as a variable name so that’s not it

tried value of cell of theObject

got same -1700 error

yeah applescript is an english language but you can guess forever and not figure out exactly what words it’s expecting.

I looked it up at apple’s developer site and the best page I found about sliders was:

http://developer.apple.com/documentation/Cocoa/Conceptual/Slider/index.html#//apple_ref/doc/uid/10000025i

Tons of info there about sliders which was cool but nothing about getting the value of a slider.

So I’m resorting to posting my question in here.

Try something like this:

content of theObject

All controls have that property.

See also: AppleScript Studio Terminology Reference: Control View Suite