Applescript随机延迟

Applescript随机延迟,applescript,Applescript,我需要在一天中的任意时间播放声音 如何创建一个随机延迟函数,然后通过系统音频播放文件?试试这个 on run {} my doit() end run on doit() display dialog "hello world" end doit on idle {} set ran to random number from 0 to 10 doit() return ran end idle 确保将其保存为保持打开应用程序延迟x以整数作为参数 从

我需要在一天中的任意时间播放声音

如何创建一个随机延迟函数,然后通过系统音频播放文件?

试试这个

on run {}
    my doit()
end run

on doit()
    display dialog "hello world"
end doit

on idle {}
    set ran to random number from 0 to 10
    doit()
    return ran
end idle
确保将其保存为保持打开应用程序

延迟x以整数作为参数


从a到b的随机数在值a和b之间生成一个随机整数

@bigmapidea欢迎使用,请不要忘记接受8^)