I have app created (Cocoa-AppleScript Application) that executed a shell command using the value of a user-supplied text field and an “install” button. I would like to grow the application to incorporate radio buttons (list) that allow a user to select one or more radio buttons and upon clicking the install button, the correlating command to each radio button will execute. I havent been able to find much info online related to radio buttons and if statements.
I did find this article but it doesnt appear to work with xcode 4:
http://macscripter.net/viewtopic.php?id=24755
on InstallButton_(sender)
set hostName to ""
set hostName to textField's stringValue as string
do shell script ("/usr/sbin/scutil --set HostName " & hostName) with administrator privileges
do shell script ("/usr/sbin/scutil --set ComputerName " & hostName) with administrator privileges
#IF RADIO BUTTON 1 IS SELECTED
RUN COMMAND1
#IF RADIO BUTTON 2 IS SELECTED
RUN COMMAND2
end InstallButton_
I wasnt able to find a solution using a radio button (list) but I was able to find out how to get the exact result using checkboxes. property checkBox :
if the checkbox is checked the checkBoxValue parameter = 1 if it is not checked the value is 0.