This didn't work for me:
repeat (display dialog "Enter the heart rate or percentage" default answer eightyPercent buttons {"Cancel", "Percentage", "Heart rate"} default button 3) set {TR, BR} to {text returned of the result, button returned of the result} set NR to TR as number
if ((NR is greater than MaxSafe) and (BR is "heart rate")) or ((NR is greater than 100) and (BR is "percentage")) then set icn to warning else set icn to informational end if if BR is "Heart rate" then set percentage to ((NR / MaxSafe) * 100) as integer display alert "Your heart rate was " & (percentage as text) & "% of the Maximum safe heart rate." as icn else if BR is "Percentage" then set heart_rate to (MaxSafe * NR) / 100 as integer display alert "Your heart rate was " & (heart_rate as text) & " beats per minute." as icn else tell me to quit end if end repeat
-- Michelle |