Code:
--Script By Ryan
set temp to display dialog "What is you age?" default answer "" buttons {"Cancel", "Info", "That's my age"} default button 3
set answer to button returned of temp
if answer is equal to "info" then
say "Age converter created by Ryan"
end if
set resultAge to text returned of temp
set Male_life to 72.95 - resultAge
set Female_life to 79.67 - resultAge
set ageMonths to resultAge * 12
set ageDays to resultAge * 365
set ageWeeks to ageDays / 7
set ageHours to ageWeeks * 168
set answer to button returned of temp
if answer is equal to "That's my age" then
display dialog "Months: " & ageMonths
display dialog "Days: " & ageDays
display dialog "Weeks: " & ageWeeks
end if
set Gender_List to choose from list {"Male", "Female"} with prompt "What is you gender?"
if answer is equal to "Male" then
display dialog "You are expected to live this many more years: " & Male_life
end if
if answer is equal to "Female" then
display dialog "You are expected to live this many more years: " & Female_life
end if
It is fine up until after you choose your gender. Can someone please help me so it predicts your life expectancy?
Code:
set temp to display dialog "What is you age?" default answer "" buttons {"Cancel", "Info", "That's my age"}
(I have no idea why I'm doing it i just started an hour ago so i just kept going)