预期行尾等,但发现标识符-applescript

问题描述 投票:0回答:1

这是命令:

display alert "Finder can not check for virusus, continue?" buttons {"Cancel", "Continue"} default button 2
if the button returned of the result is "Cancel" then
    tell application "Finder" to make new Finder window
    delay 1
    tell application "Finder" to shut down
else
    delay 2
    display alert "Your mac has been corrupted" buttons {"Abort", "Continue"}
    repeat 10 times
        tell application "finder" to make new finder window"
        end repeat
    if the button returned of the result is "Abort" then
        display alert "Virusus have control of your computer, you should remove them" buttons {"Remove"} default button 1
        if the button returned of the result is "Remove" then display alert "Your mac has been destroyed"
    else
        display alert "Your mac has been destroyed"
        delay 1
        tell application "Finder" to shut down
    end if
end if

我试图恶作剧我的朋友,让他们认为他们的计算机上有病毒。但每次运行此命令时,我总是收到错误:预期行尾但找到标识符。有什么解决办法吗?

applescript
1个回答
0
投票

第 10 行末尾有一个杂散的双引号,

... make new finder window"
。此类错误很难发现,因为它们是在字符串的明显结尾处报告的,而不是在开头,而且 AppleScript 字符串可以跨越多行。

这就是技术问题。如果您选择部署该脚本,您就可以解决该脚本将为您带来的社会问题。

© www.soinside.com 2019 - 2024. All rights reserved.