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

cleanair

macrumors regular
Original poster
Aug 13, 2015
165
0
If you want to play music on iTunes while you fall asleep, but don't want it playing all night, how can you make it automatically stop after certain amount of time?
 
I'm sure someone can come up with a more user-friendly answer, but in Terminal:

sleep 3600 && osascript -e 'tell application "iTunes" to pause'

...will tell iTunes to stop playing after one hour.

A.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.