首页 > 解决方案 > (AppleScript)是否可以编写一个对话框,每次看到它时都会显示一个随机字符串?

问题描述

当您在对话框(或类似内容)上单击“确定”时,它会显示一个对话框,其中包含随机生成的字符行。

标签: applescript

解决方案


set theChars to {"a", "b", "c", "d", "e", "f"}
set theRandomWord to ""
repeat 5 times
    set theRandomWord to (theRandomWord & some item of theChars)
end repeat

display dialog (theRandomWord)

推荐阅读