(using xcode/applescript)
I have a window with a segmented control (with 2 buttons) and a push button. The push button is linked to this code:
My problem is with the if statement. My log shows the following when the left button of the segmented control is active:
and the following when the right button is active
So it seems that 'log selectedSegment of segment' is returning the right value while the if statement doesn't work. Any idea what I'm doing wrong?
(I'm very new to xcode/applescript and just use it for some personal scripts, so please excuse me if this question is really nubish )
I have a window with a segmented control (with 2 buttons) and a push button. The push button is linked to this code:
Code:
property segment : missing value
on buttonPressed_(sender)
log selectedSegment of segment
if (selectedSegment of segment) = 1 then
log "1"
else
log "0"
end if
log "---------"
end buttonPressed_
My problem is with the if statement. My log shows the following when the left button of the segmented control is active:
Code:
0
0
---------
and the following when the right button is active
Code:
1
0
---------
So it seems that 'log selectedSegment of segment' is returning the right value while the if statement doesn't work. Any idea what I'm doing wrong?
(I'm very new to xcode/applescript and just use it for some personal scripts, so please excuse me if this question is really nubish )
Last edited: