2015-12-02 1 views
-2
display dialog "Your Computer Has Been Taken Over By Ninja Cows With Flamethrowers!" buttons {"Ok......"} default button 1 

display dialog "How Would You Like To Proceed?" buttons {"Milk Them", "Burn Them", "Do Nothing"} default button 1 

if the button returned of the result is "Milk Them" then 
    beep 1 
    delay 1 
    display dialog "You milk them day and night but unlucky you spilt the milk on to the computer, the computer crashes and the batery shoots out, you failed" buttons {"Wait, What?"} default button 1 
    tell application "Finder" 

     shut down 
    end tell 
else 

    if the button returned of the result is "Do Nothing" then 
     display dialog "The cows look at you, they are just staring eager to destroy somthing, after 23 hours and 59 minutes they burn the place to the ground, rupturing the lithium ion battery. 
your computer explodes, you explode and everything explodes." buttons {"Wait, What?"} default button 1 
     tell application "Finder" 

      shut down 
     end tell 
    end if 


    if the button returned of the result is "Burn Them" then 
     display dialog "You grab a even bigger flamethrower from your bottemless bag and burn them to the ground YOU DID IT!, unfortunataly apples new chipset in not designed to withstad such heat, the computer explodes, you explode, everything explodes. Hey, atleast you got the cows this time.." buttons {"Wait, What?"} default button 1 
     tell application "Finder" 

      shut down 
     end tell 
    end if 

end if 
end 
+0

их Ожог не кажется, возможность работать –

+0

Go получить больше огнемет – Marged

ответ

0

Причина в том, что внутренняя переменная result всегда содержит результат предыдущей строки.
Используйте это:

set buttonReturned to button returned of (display dialog "How Would You Like To Proceed?" buttons {"Milk Them", "Burn Them", "Do Nothing"} default button 1) 

if buttonReturned is "Milk Them" then 
    -- proceeed button 1  
else if buttonReturned is "Do Nothing" then 
    -- proceeed button 2  
else 
    -- proceeed button 3  
end if 
Смежные вопросы