我真的很新AppleScript编码,我想知道这段代码出了什么问题。错误是“变量结果未定义”。为什么发生错误?我的代码如下:变量结果未定义
display dialog "Hello and welcome to my app!" buttons {"Login", "Quit"} default button 1
if the button returned of the result is "Login" then
display dialog "Username:" buttons {"Raphi", "Guest"} default button 1 with title "Choose user"
else
tell application "My app" to quit
end if
if the button returned of the result is "Raphi" then
display dialog "Password:" default answer "" buttons {"Submit"} with title "Enter password" with hidden answer
else
display dialog "You have selected guest! Guest is not currenty enabled, please ask Raphi to enable it. Thank you!" buttons {"OK"}
end if
if the text returned of the result is "123" then
display dialog "Would you like to continue or exit?" buttons {"Continue", "Exit"}
else
display dialog "Incorrect password" buttons {"OK"} default button 1 with icon stop
end if
if the button returned of the result is "OK" then
tell application "My app" to quit
end if
if the button returned of the result is "Continue" then
display dialog ""
else
tell application "My app" to quit
end if