Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hawker2017

macrumors newbie
Original poster
Mar 25, 2012
1
0
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
 
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
 
Last edited:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.