2015-12-02 105 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

去獲得更大的火焰噴射器 – 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 
相關問題