gpt4 book ai didi

applescript - 如何处理 AppleScript 对话响应?

转载 作者:行者123 更新时间:2023-12-04 03:22:16 25 4
gpt4 key购买 nike

我正在使用我编写的脚本自动将动态 IP 写入 .txt 文件,但我的问题是单击退出按钮时我无法关闭对话框。

set yn to (display dialog "Your ip has been written to the server, the application will re-run in 10 minutes if you DO NOT close this window." buttons {"Quit", "Run again"} giving up after 600)
if yn is equal to "Quit" then
quit
end if

最佳答案

我最后做的是

display alert "This is an alert" buttons {"No", "Yes"}
if button returned of result = "No" then
display alert "No was clicked"
else
if button returned of result = "Yes" then
display alert "Yes was clicked"
end if
end if

您可以将“display alert “No/Yes was clicked””行替换为您想要运行的任何代码

关于applescript - 如何处理 AppleScript 对话响应?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15170180/

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