It must annoy me when I don't expect it.
March 1, 2011 6:01 PM   Subscribe

I need a program that will randomly pick a time to sound an alarm without my knowing in advance. It needs to be available for Mac or iPhone -- or failing that, a physical device that I can keep around would work too.

I've had no success searching for this because all "random alarm" searches return only programs that will vary the sound played, not the time it's played.

What I want is an alarm that will go off when I cannot predict it. I don't care what sound it makes. I do not want to have to generate a random time and then manually set an alarm, because it will defeat my purpose. The point is that it must catch me off-guard.

The why of it is a long story of an experiment I'm doing, so just trust me that knowing the time the alarm will go off is the entire thing I'm trying to avoid. If I can know it at all, there is no experiment. It's not feasible for me to ask other people to set the alarm for me because 1) I need to do this multiple times at whatever hour it goes off, and 2) my husband is the only one who could really do that if he's even at home, and it's so arbitrary and up to his discretion that he'd find it overwhelming. Plus, 3) I'm not sure how anyone could do that and keep the countdown hidden from me when they leave, hence the need for the program to keep it hidden from the user.

It's a plus if I can temporarily disable it when I absolutely can't have alarms going off, or control the time range during which it is permitted to go off -- e.g. stop it from going off when I'm likely to be asleep -- or set a minimum and maximum time span during which it must go off -- i.e. no more than once a day, but no less than once a week. But for now, those are not necessary and I just want it go nuts whenever.
posted by Nattie to Computers & Internet (16 answers total) 5 users marked this as a favorite
Astrid has a feature called Random Reminder but I don't know whether it will work on your hardware.
posted by carmicha at 6:14 PM on March 1, 2011

Would the Annoy-a-tron do the trick?
posted by ntartifex at 6:15 PM on March 1, 2011

Choose any frequently-published blog, hook it up to Growl for notifications of new posts, and set a noisy alarm.

There are also a lot of behavior studies which use digital wristwatches or beepers to elicit a random response, but I'm not sure if they're pre-programmed by the researchers or set up to be truly random.
posted by acidic at 6:23 PM on March 1, 2011

If you don't find a program that does this, it'd be very easy to write in python.. e.g. below.
The example will require snack toolkit installed on macs. (snack toolkit - they will give an example in thier docs on how to import it in the script)

from time import sleep
from random import randint

s = Sound()'sound.wav')

while 1:
         sleep(60*randint(1,120) # wait randomly from 1 to 120 minutes
posted by rainy at 6:28 PM on March 1, 2011

Response by poster: From what I can tell, the Astrid feature would probably work for me, but it's Android-only. :( It's heartening to see evidence that the feature isn't unheard of though, haha.

The annoy-a-tron says it sounds every couple minutes, which is way too frequently for my purposes. :(

I need something that sounds, at most, twice a day, but really once every two days at worst would be better. The intervals need to be long enough that I don't constantly anticipate the alarm going off, or there's no experiment; it's basically to test how my mood is affected by being able to anticipate doing something versus doing it (relatively) randomly. So for my purposes, a too-frequent alarm has the same effect as scheduling an alarm; it will put me in the mindset of dwelling on the feeling of "ugh, I have to _____ soon."

Same goes for setting it to something like a blog -- they publish too frequently and at predictable hours, so I would mentally start anticipating when it would go off. Although hooking something to Growl is a good idea, I just don't know what would be random enough.

Thank you rainy, I might do just that!
posted by Nattie at 6:42 PM on March 1, 2011

If you do use that, I also missed closing bracket in 2nd to last line, should be:

sleep(60*60*randint(24,48)) # wait 24-48 hours
posted by rainy at 6:47 PM on March 1, 2011

I think you'd be better off with sleep(randint(3600*24, 3600*48)) because as it stands the code will always sound the alarm a whole number of hours from the last time, which would raise anticipation after a while.
posted by flabdablet at 6:52 PM on March 1, 2011

Best answer: AppleScript on the Mac would be easy.

set minVal to text returned of (display dialog "Please enter the minimum number of minutes between alarms:" default answer "")
set maxVal to text returned of (display dialog "Please enter the max number of minutes between alarms:" default answer "")

set randVal to random number (maxVal)
if randVal > minVal then
exit repeat
end if
end repeat

delay 60 * randVal
beep 5
--Send Email
do shell script "echo \"Your alarm is going off.\" | mail -s \"Alarm Done\""
end repeat

Spotlight search for "Applescript Editor" and paste this code in.
Change the email address on the second to last line to the text message email gateway for your phone. (e.g. and it will text you when the alarm goes off.
Finally save it as an application and run it.

To quit the app, right click on the icon in the dock, hold down the option key, and select "Force Quit".
posted by 47triple2 at 7:00 PM on March 1, 2011 [1 favorite]

Two thoughts: 1. There may be medical applications that would work for you. When I was looking into Astrid I read about a therapy for diabetics that postulates improvement if insulin is delivered at random times. 2. There may also be applications intended for psychology experiments, e.g., to prompt subjects to complete, say, a diary entry whenever the random signal sounds.
posted by carmicha at 7:02 PM on March 1, 2011

posted by carmicha at 7:06 PM on March 1, 2011

Just open and type:

while true; do sleep $(($RANDOM % 86400)); echo '^G^G^G'; done

where each ^G is created by typing control-V control-G – type that as many times as you want the bell to ring. This will wait for up to a day, then play three bells, then do it again, until you type control-C to stop it. Plug some powered speakers into your Mac and make it as loud as you like.

(If you specify "at most twice a day", then you know when the bell sounds that you have at least until 24 hours after the previous bell to relax. Doesn't that violate your primary objective?)
posted by nicwolff at 7:50 PM on March 1, 2011

posted by unknowncommand at 8:06 PM on March 1, 2011

Response by poster: I tried the AppleScript and it worked, except that it didn't send the text properly and I didn't notice the alarm go off on my computer (I tested it again to make sure it does go off and it does, I just didn't notice it). The text I would be sure to notice, though.

I did replace the e-mail address with the proper texting address and tested it manually to make sure the address does work. I think it might have something to do with how it sends the mail? I don't actually use any programs on my Mac for e-mail, just the Gmail browser interface, so it occurs to me that it wouldn't know what/who to send the e-mail from; I don't know if it uses the mail program or some setting somewhere on my computer where I can fill in my primary e-mail information. I don't yet know enough about AppleScript to figure out how to fix that, but I will poke around tonight. Once I figure that out, it will be be almost perfect for what I need. :D Thanks so much!

I still need to try the Python and Terminal options, thank you both! The AppleScript really appeals to me because it can text me if I'm not by my computer so I've put my time into tinkering with it for now, but I appreciate having so many options. :D

Annoyster and InnerTwitter are very nearly what I want, the intervals are just slightly too short for me. I wonder why Annoyster decided to cap it at six hours?

Thank you all for the suggestions!
posted by Nattie at 9:47 PM on March 1, 2011

Post to Metafilter Jobs and get a dozen random strangers to text you at random times of day. Include some people in other countries to add some entropy. You might want to assign them windows of time so you don't get 35 right off the bat.
posted by advicepig at 7:31 AM on March 2, 2011

Best answer: The AppleScript is sending mail from the command line. You can set it up to do it from Gmail (self link) or, even better, Google Voice.

For Google Voice, once it is set up at, use these files (compressed zip file).

Edit so that your username and password are entered. Then put both and together in some folder. Finally, edit the script so the top three lines say the appropriate stuff. For the file path, you can drag from Finder into AppleScript Editor and it will auto-fill it for you.
posted by 47triple2 at 8:14 AM on March 2, 2011

Response by poster: Yesss, the AppleScript now works for me and it's awesomeeeeeeeee omg ty ty ty
posted by Nattie at 10:31 PM on March 3, 2011

« Older Not shoes made out of giraffes, no.   |   How do I get that holiday feeling? Newer »
This thread is closed to new comments.