Resolved I need help

Discussion in 'Mac Programming' started by samdaman13, Mar 16, 2013.

  1. samdaman13, Mar 16, 2013
    Last edited: Mar 17, 2013

    samdaman13
    Expand Collapse
    macrumors newbie

    Joined:
    Mar 16, 2013
    #1
    I am a new user to Mac and I need help.
    The error is:
    Can’t get button returned.
    I am trying to prank my friend with this script that I will save as an application.


    Code:
    display dialog "VIRUS! VIRUS!" buttons {"Destroy it"} default button 1
    if button returned is "Destroy it" then
    	tell application "Finder" to sleep
    	display dialog "You cannot destroy me" buttons {"Yes I can"}
    else if button returned is "Yes I can" then
    	
    	tell application "System Preferences" to activate
    	
    end if
    Any help is appreciated
     
  2. larswik
    Expand Collapse
    macrumors 68000

    Joined:
    Sep 8, 2006
    #2
    First step is to post your code. People cant help you unless they see the code that is not working.
     
  3. kryten2
    Expand Collapse
    macrumors 6502a

    Joined:
    Mar 17, 2012
    Location:
    Belgium
    #3
    Try this :

    Code:
    if button returned of the result = "Destroy it" then
    or

    Code:
    set theResult to button returned of (display dialog "VIRUS! VIRUS!" buttons {"Destroy it"} default button 1)
    if theResult is "Destroy it" then
    Ask yourself what will happen then. You need to work on your logic.
     
  4. samdaman13
    Expand Collapse
    thread starter macrumors newbie

    Joined:
    Mar 16, 2013

Share This Page