Simple AppleScript question...

Trip

Registered
I'm 1) too lazy to think this out on my own and experiment. 2) too tired to think about 1. So: i have a script:


tell application "Finder"
say "Some text here."
end tell


And what i want to do is have, say 5 different quotes and i want the script to randomly choose a quote to say and speak it. Get what i'm trying to say? Go ahead and throw around your answers, i'm sure somebody will get it right. :)
 
here u go, trip!!

Code:
set a to {"one", "two", "three", "four", "five"}
set x to (random number from 1 to 5)
say (item x of a)
 
Although it does linger on four quite a lot it works!!! Thanks! I didn't realize it was that easy. :D
 
Back
Top