首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我如何对其进行编码,以便在不同的位置同时弹出两个警报?

我如何对其进行编码,以便在不同的位置同时弹出两个警报?
EN

Stack Overflow用户
提问于 2021-09-14 09:55:57
回答 1查看 52关注 0票数 0
代码语言:javascript
运行
复制
repeat
display alert "Don't you dare close this button" buttons {"ok"}
if the button returned of the result is "ok" then
    display notification with title ":))))))))" subtitle "muahahahahahhh" sound name "Frog"
    display alert "Don't you dare close this button" buttons {"ok"}
    display alert "Don't you dare close this button" buttons {"ok"}
end if
end repeat

我不知道我做错了什么,我做了两个显示警报。也许有人能帮我这个忙?提前谢谢你

EN

回答 1

Stack Overflow用户

发布于 2021-09-14 16:28:00

你不能,但是…

如果您从其他进程中获得了一点帮助,您可以:

代码语言:javascript
运行
复制
ignoring application responses
    tell application "Finder" to display alert "Don't you dare close this button" buttons {"ok"}
    display alert "Don't you dare close this button" buttons {"ok"}
end ignoring

不幸的是,警报在屏幕上的相同位置。

顺便说一句,你的测试"if the button returned of the result is "ok" then“是没用的,因为结果只能是"ok”。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69175665

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档