开发者

Applescript Random Delay

I need to play a sound at random times throughout the day.

How can I create a random delay function, tha开发者_StackOverflow社区t then plays the file through the system audio?


delay x takes an integer for an argument.

random number from a to b generates a random integer between values a and b


try this

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

be sure to save it as stay open application

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜