E-Mail:

Add a Sleep Timer to iTunes

  • No Related Post

In college, when space (and cash) is limited, your Mac might be your stereo. I was as lucky. Your typical stereo has a sleep timer, but what about iTunes you ask? A very simple four line AppleScript will give the function to iTunes or any other OS X application you want. Want to close Photoshop at 4am? Why not. You can. And here’s how.

1. Create a folder called “Scripts” in the “Users/you/Library/iTunes/” directory.
2. Open the Script Editor located in “Applications/AppleScript/” folder.
3. Type your code:

Tell application “iTunes”
Delay 3600
Quit
End tell

4. In the File> Save As… menu save the script as a application, deselecting the Startup Screen and Stay Open options. Save it to your newly created “Scripts” folder with whatever name you want.
5. Open up iTunes. You’ll see a new menu that will give you access to all your iTunes AppleScripts.

You can edit the time to whatever you’d like. It just takes a bit of math. The timer is in seconds, so 1800 is 30 minutes, 3600 is 60 minutes, and 6400 is 90 minutes. To figure out your desired time just multiply the number of minutes by 60 (x*60). Like magic.

To apply this to other OS X applications edit “iTunes” to the name of the application (with quotes). “DVD Player”, “Quicktime Player”, “VLC”, etc.

Sweet dreams.

4 Comments

There’s also a free iTunes sleep timer at:
http://www.zztimer.com/

There isn’t a lot of flexibility and it makes the menu bar all screwy, but at least it’s basic enough to get the job done :D

Hey guys,

So I am running this script with VLC player. I was able to make an app that worked correctly, however VLC does not have a folder in the user/library/ directory so I was not able to make the script appear in the actual player menu. I tried creating a folder user/library/VLC/Scripts containing the sleep app, however this still did not work. Does anyone know how I could make the sleep scripts appear on the VLC menu?

Thank you!

This is exactly what I was looking for: simple, fast, and no extraneous software.

What Do You Think?

 
53 queries / 0.133 seconds.