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)
推荐阅读
- excel - 返回二维数组中匹配项的行号
- docker - Docker 工具箱被命令卡住了
- javascript - 将查询结果传递给从 node.js 到 html 的变量
- javascript - 下拉列表中的默认值
- css - gtkmm 3.10.1 中带有 CSS 的 Gtk::Box 样式问题
- reactjs - 在部署在 kubernetes 上的 React JS 项目中使用配置映射
- mysql - 频繁更新单个表与使用另一个表和 CRON 将更改导入 MySQL 中的主表?
- java - 从注解处理器生成 Spring 组件
- ios - 为什么多次购买消耗品?
- sql - Oracle - 将计算的数字字段与字符串字段连接起来