Hi guys!
I’m trying to make a simple trivia game, but I keep getting an error: ‘can’t make {<>: “Next”} into type string’ whenever I click a wrong answer and choose “Next”…
What am I doing? Here’s the code (only one question as it’s so long):
display dialog "Welcome to the Everything Goes Trivia Game!" & return & return & "You are encouraged to use the book to help you complete this game!" with title "Everything Goes Trivia Game" buttons {"Cancel", "About this app!", "Start!"} default button 3
set theButton to button returned of the result
if theButton = "About this app!" then
display dialog "Everything Goes Trivia Game" & return & "©2011 Wilson Biggs. All rights reserved." & return & return & "Permission to create this app from Brian Biggs." with title "About this app!" buttons {"Start!"} default button 1
set theButton to "Start!"
end if
if theButton = "Start!" then
set right_num to 0
display dialog "What song is the man singing when Henry and his dad drive through the rail yard?" buttons {"Big Rock Candy Mountain", "I've Been Working on the Railroad", "Crazy Train"}
set answerButton to button returned of the result
if answerButton = "I've Been Working on the Railroad" then
display dialog "You got it right!" buttons {"Next"} default button 1 with icon alias ((path to me) & "Contents:Resources:thumbs_up.icns" as string)
set right_num to right_num + 1
else
display dialog "You got it wrong!" buttons {"Quit", "Next"} default button 2 with icon alias ((path to me) & "Contents:Resources:thumbs_down.icns" as string)
set wAnswerButton to button returned of the result
if wAnswerButton = "Quit" then
return
end if
end if
end if
Model: iBook G4
AppleScript: 2.1
Browser: Safari 533.19.4
Operating System: Mac OS X (10.4)