PDA

View Full Version : Apple Script Help




Hawker2017
Mar 25, 2012, 06:09 PM
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



kryten2
Mar 26, 2012, 03:57 PM
Take a look at the Applescript examples when in doubt. Notice the red lines.

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
end if
end if
I think this is what you intended to do with your code