Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

RBPierce

macrumors newbie
Original poster
Apr 1, 2011
2
0
Hey guys. I have an idea for a prank- I'd like to tie the console "say" command to a keypress event, so that whenever someone types the Enter key, the mac says "Access denied!"

I tried playing around with Applescript, but couldn't make any progress on it. Any ideas?
 
Applescript:

set countdown to 60
set delaySecs to 5
repeat countdown times

say "You have a virus" using "Cellos"
# say "You have a virus" using "Whisper"
# say "You have a virus" using "Good News"

set msg to "Your computer hard drive will be deleted " & countdown & " seconds"
display dialog msg buttons "Ok" with icon caution giving up after delaySecs
set countdown to countdown - delaySecs
if countdown ≤ 0 then exit repeat
end repeat

display dialog "Macs do not get viruses"



Tied it to a key with Spark :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.