radio buttons not toggling between choices

Here’s a quick 4 minute video of me trying to build a simple set of two radio buttons with a choice of ‘Left’ and ‘Right’, which fails. I do add in a button to display a dialog box, which confirms I’m actually passing the value of the button clicked back to the applescript. I just can’t get the radio buttons to toggle as expected.

Can someone tell me what I’m doing wrong? This method works fine for checkboxes. I’m just missing the bit that culls the radio buttons in to a group so that when one is selected the other is deselected.

Bonus round: What’ I’d really like to do is pass the title of the radio button back to the variable; in this case that would be ‘Left’ or ‘Right’ depending on which button is clicked. But, I’m happy with making baby step progress.

The buttons must belong to the same view, and call the same action handler.

[final edit]

ok, finally poked in the dark long enough to figure it out.

the buttons were already in the same view. so, check that box off.

I needed to create an action handler, as Shane suggested. So, I created:

on radioClicked_(sender)
      set modifierReceived to sender's title as string
end radioClicked_

the tricky bit was getting the title back from the button sent. that bit of verbage took a minute to suss out.

But, now It’s working great. Thanks.

You’re getting the sender’s title in the handler, so you probably don’t need to use a binding – it’s redundant.

i think we were posting the same thing at the same time. see my edit above. thanks for your help.

[edit] nvm

must have been a bug somewhere. i recreated the app from scratch and it works fine.