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
精彩评论