gpt4 book ai didi

applescript - 如何告诉 Applescript 停止执行

转载 作者:行者123 更新时间:2023-12-03 09:50:24 26 4
gpt4 key购买 nike

Applescript 的“从列表中选择”用户交互有一个“取消”按钮——我希望这个“取消”告诉脚本立即停止执行。换句话说:

 set wmColor to choose from list {"Black", "Black for all", "White", 
"White for all"} with prompt "What color should the watermark be?"
default items "White for all" without multiple selections allowed and
empty selection allowed
if wmColor is false
*tell script to stop executing*
end if

似乎无法找到如何做到这一点 - 有谁知道如何?

最佳答案

错误号 -128 是“用户已取消”,并将停止脚本 - 例如:

if wmColor is false then
error number -128
end if

关于applescript - 如何告诉 Applescript 停止执行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8621290/

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