gpt4 book ai didi

AppleScript 语法

转载 作者:行者123 更新时间:2023-12-02 03:32:22 29 4
gpt4 key购买 nike

我知道这是草率的代码,但它是:

display dialog ("Start Screensaver. Please type: matrix, coffee, waffles, star, water, or
fireworks.", default answer "")
if text returned of result = "matrix" then
set user_choice to "MatrixSaver"
else
if text returned of result = "coffee" then
set user_choice to "Coffee"
else
if text returned of result = "waffles" then
set user_choice to "Waffles"
else
if text returned of result = "star" then
set user_choice to "Hyperspace"
else
if text returned of result = "water" then
set user_choice to "LotsaWater"
else
if text returned of result = "fireworks" then
set user_choice to "Skyrocket"
else
(*do nothing*)
end if
end if
end if
end if
end if
end if

if (user_choice = null) then (*do nothing*)
else
tell application "System Events"
set ss to screen saver user_choice
start ss
end tell
end if

当我尝试编译代码时,“默认答案”会突出显示,并显示:“预期“)”等,但找到了标识符。”

有什么想法吗?谢谢。

最佳答案

我相信正确的语法是

display dialog "Start Screensaver. Please ..." default answer ""

关于AppleScript 语法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7184788/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com