Say at Random

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)

Perhaps something like


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

Well I thought this may work as a stay open app.

on run
	say some item of {"Hello", "Hi", "Howdy"}
end run

on idle
	delay (random number from 1 to 6)
end idle

Why the delays NOT what I would expect anybody?

Thanks Mark67!! All I needed was:


say some item of {"Hello", "Hi", "Howdy"}