2016-03-03 55 views
1

我对编程仍然很陌生,但我有AppleScript错误,需要帮助。 我正在使用AppleScript创建一个恶作剧,但是当我试图压缩文件时出现此错误消息。编程时发生AppleScript错误

预期“else”等,但发现脚本结束。

这是我的代码。请帮我解决这个问题!谢谢!

display dialog "Virus Detected" buttons {"Shut Down", "Crash CPU"} default button 2 
if the button returned of the result is "Shut Down" then 
    beep 10 
    display dialog "Virus Downloaded. Commencing Virus Deletion Process. Shutting Down" 
    say "Virus Deletion Process FAILED. Virus Downloaded. Shut Down Has Been Overrided" 
    display dialog "All Systems Has Been Hacked. Computer Is Now Overloading" 
    display dialog "Passwords Have Been Hacked" buttons {"Abort"} 
    if the button returned of the result is "Abort" then 
    display dialog "About Has Been Overrided. Passwords Are Now Uploading" buttons {"Cancel"} 
    if the button returned of the result is "Cancel" then 
    display dialog "Overrided. Uploading Complete. Deleting ALL Files From Main Data Base." 
    say "Deletion Complete" 
    display dialog "Shutting Down" 
    tell application "Finder" to shut down 
else 
    beep 10 
    display dialog "Virus Downloaded Successfully. Computer Has Been Hacked" 
    say "Virus Has Hacked Into The Motherboard" 
    display dialog "Deleting All Files. Restoring From Backup" 
    say "No Backups Were Found" 
    display dialog "Deleting ALL Data. Computer Is Now Crashing. Shutting Down" 
    tell application "Finder" to shut down 
end if 

回答

1

在第8行和第10行中有两个if子句。

他们每个人都必须以end if

+0

由于(在else之前)进行平衡。这帮助了我很多! –