我真的很新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