Pause Your Media Player For 5 Minutes With A Keyboard Shortcut

Windows/Mac: If you listen to a lot of music during the day, you probably pause it every once in a while when you need to focus — and then forget to un-pause it. Here’s how to pause it for just five minutes.

I don’t know about you, but I pretty much crank my music from the moment I wake up to the moment I go to sleep. A few times a day, though, I need to pause my music to focus more intently on something, like a conversation with my boss or a particular down-to-the-wire deadline. The problem is, I usually forget to un-pause it after I finish, and I realise I’ve wasted an hour of solid music listening time.

An app for the Mac called Take Five has a cool feature where it pauses iTunes for just five minutes, so you don’t forget to turn your music back on. However, the program was $5, and I wasn’t about to pay for something that I could do myself with 15 seconds of scripting. Here are the scripts, for both Windows and Mac.

In Windows, this is easily achievable with an AutoHotkey script. There are a bunch of different ways to do it, depending on your media player program, but this script should work with almost everything:

!+p::
sendinput {Media_Play_Pause}
sleep 300000
sendinput {Media_Play_Pause}
return

Where !+p (Alt+Shift+P) can be replaced with whatever keyboard shortcut you want. Keep in mind if you’re using iTunes, you’ll need mmKeys.dll installed if you don’t have it already.

Mac users just need to copy and paste the following code into AppleScript editor:

tell application “iTunes”
pause
delay 300
play
end tell

Save it in a safe place and assign it a keyboard shortcut with Quicksilver.

What’s also nice about both of these scripts is that you can customise how long you want it to stay paused. just replace the 300000 or 300 value in the AutoHotkey script or AppleScript (respectively) with how long you want to wait. In the AppleScript, that number is how many seconds iTunes stays paused, while it’s the number of seconds times 100 in the AutoHotkey script.

Of course, we know a bunch of you are even bigger AutoHotkey and AppleScript masters than us, so if you have any tweaks to share, hit us with them in the comments.


The Cheapest NBN 50 Plans

Here are the cheapest plans available for Australia’s most popular NBN speed tier.

At Lifehacker, we independently select and write about stuff we love and think you'll like too. We have affiliate and advertising partnerships, which means we may collect a share of sales or other compensation from the links on this page. BTW – prices are accurate and items in stock at the time of posting.

Comments


One response to “Pause Your Media Player For 5 Minutes With A Keyboard Shortcut”

Leave a Reply