Can you use AppleScript to say at random, wherein you have two sayings {“hello”, “hi”}? Then at random it says one or the other. I would like to program some attitude and personality into my Mac. I think it would be funny.
Model: iMac
AppleScript: 2.3 (118)
Browser: Safari 533.19.4
Operating System: Mac OS X (10.6)
set Phrases to {"Hello", "Hi", "Howdy"}
set weights to {0.4, 0.8, 1.0}
set chosenNumber to random number
repeat with i from 1 to (count of Phrases)
if chosenNumber < (item i of weights) then
say (item i of Phrases)
exit repeat
end if
end repeat