Introduction: Wireless Headphones 3 Minute Transmitter Cut-off Fix (mac Only)

Hi there,

I have a pair of Sennheiser TR120 wireless headphones (I've had them a good few years, I think they're called RS120 now) and when there's no signal for 3 minutes, the transmitter cuts off and you get a horrible white noise static through the headphones.. Frequently, I'll fall asleep listening to music and when the music ends, three minutes later I get a blast of white noise.. Not cool..

So I've written a little AppleScript/Automator app that plays a system sound after 150 seconds so the transmitter doesn't cut off. I've also put in a little conditional testing so it won't play the sound if iTunes is playing. It's my first dabble with AppleScript/Automator so it's super simple to set up.

If you've got a similar set up, this should help..

Step 1: Fire Up Automator

To start, open up Automator (cmd+space for Spotlight, then type "Automator" or click on the app in your Applications folder)

A dialogue box appears asking which template to use, choose "Application".

In the "Actions" library click "Utilities" and choose "Run AppleScript" (or type "run a" in the search box and it'll show up)

Drag "Run AppleScript" on to the right panel, you should see a box with:

"on run {input, parameters}
(* Your script goes here *)
return input
end run"

Select all the code in that box and replace it with:

on run {}
tell application "iTunes"
if player state is paused or player state is stopped then
do shell script "/bin/bash"
do shell script "afplay /System/Library/Sounds/Submarine.aiff"
end if
end tell
end run

The code should be pretty self explanatory, the list of system sounds available are:

Basso
Blow
Bottle
Frog
Funk
Glass
Hero
Morse
Ping
Pop
Purr
Sosumi
Submarine
Tank

You can use any of these instead of "Submarine", I've chosen it because it's fairly inoffensive and not too harsh on the ears. You can also use any sound you want, just make sure the path is correct.

Once that's done, move on to the next panel in the sequence..

Step 2: Add the Pause


The next thing to add is the 150 second pause.

Click "Utilities" in the library again or type "Pause" into the search box. Drag it over to the right panel under the "Run AppleScript" panel.

I've set it to 150 seconds which is 2.5 minutes but I guess anything less than 3 minutes will do the trick. For testing I set it to 3 seconds to make sure it was working properly.

Next, add the loop..

Step 3: Add the Loop

Find "Loop" in the library in the same way as the others and drag it to the right panel under "Pause".

Change the settings to "Loop Automatically" Stop after "-1" times (leave "Use the original input")

As far as the functionality is concerned, you're done.

You can test it by hitting "Run" in the top right of Automator. Try starting and stopping iTunes to make sure it doesn't fire when there's music playing (or anything else that iTunes can play, movies etc.).

Now to package it up and get it working..

Step 4: Package It Up


Now that we have everything working ok, it's time to package it up and get it running:

In Automator, click File->Save (or cmd + s), name your app (I've called mine "EarSaver.app") and save it wherever you want (the Applications folder is a good place for it). Note: make sure the file format is set to "Application".

Find your new app in "Applications" or wherever you saved it and double click it. It will show up in your dock. To get it to start automatically, right click (or ctrl click / two finger tap etc.) on the icon in the dock and in "Options" choose "Open at Login" (if you want, you can also choose "Keep in Dock" as I have for easy access)

And that's it, all done.

Change the Icon:

If you want to change the icon, find an image you want to use (preferably a png at least 128x128, there are tonnes of free icons online, use the Googles..) - Open your chosen image file in "Preview" or any image app (preview is easiest) and choose "Edit->Copy". Then go to your "EarSaver" app, right click and choose "Get Info" (or cmd+I [uppercase i]). A window pops up with the app icon at the top left. Click on the app icon and choose "Edit->Paste", your icon should now be replaced. Close it up and the job is oxo (as we say here in Ireland..).

Any feedback/suggestions or modifications welcome (this is my first 'ible!). It's a pretty specific problem but hopefully, it'll help someone who is sick of being assaulted with white noise..

Take care,

Rob.