Apple Script Help

Discussion in 'Design and Graphics' started by Hawker2017, Mar 25, 2012.

  1. macrumors newbie

    #1
    So here is my program (red)
    display dialog "T.A.R.D.I.S Controll Panel" buttons {"Fly", "Land"} default button 2
    if the button returned of the result is "Land" then
    display dialog "flight aborted"
    else
    end
    display dialog "T.A.R.D.I.S Companion Chooser" buttons {"Amy Pond", "Martha Jones"} default button 2
    if the button returned of the result is "Amy Pond" then
    display dialog "allons-y"
    tell application "iTunes"
    play playlist "Doctor Who"
    end tell
    else
    display dialog "allons-y"
    tell application "iTunes"
    play playlist "Doctor Who1"
    end


    Can any one tell me what's wrong with it
     
  2. kryten2, Mar 26, 2012
    Last edited: Mar 26, 2012

    macrumors 6502a

    #2
    Try this.

    Take a look at the Applescript examples when in doubt. Notice the red lines.

    Code:
    display dialog "T.A.R.D.I.S Controll Panel" buttons {"Fly", "Land"} default button 2
    if the button returned of the result is "Land" then
    	display dialog "flight aborted"
    else
    display dialog "T.A.R.D.I.S Companion Chooser" buttons {"Amy Pond", "Martha Jones"} default button 2
    if the button returned of the result is "Amy Pond" then
    	display dialog "allons-y"
    	tell application "iTunes"
    		play playlist "Doctor Who"
    	end tell
    else
    	display dialog "allons-y"
    	tell application "iTunes"
    		play playlist "Doctor Who1"
    	end tell
    [COLOR="red"]end if[/COLOR]
    [COLOR="red"]end if[/COLOR]
    I think this is what you intended to do with your code
     

Share This Page