Jul 29

 Images Zinc Osx Feature Applescript

I tend to listen to Podcasts (one of the best is MacBreak Weekly) while I work. But when my wife starts talking to me from the other room, I have to stop what I’m doing to navigate to iTunes just to click Pause. It finally reached a level of annoyance that made me fired up Script Editor and throw together a little script to do it for me. This is just about as simple an Apple Script as you can get:

tell application “iTunes”

playpause

end tell

Now, just save it as an application and bind it to some key you’re not using. I used one of the buttons on my Wacom Tablet. One key press and the podcast will either pause or play depending upon its current state.

It’s so great that Apple included a little hook for the Pause/Play function. This is yet another great feature of OSX. If something’s missing that you really want it to do, chances are that a short Apple Script or Automator Action can remedy the situation.

I think this little trick will hold me over until that new keyboard sees the light of day.

Technorati Tags: , , , , ,

4 Responses to “One script to rule them all”

  1. Ponder Says:

    …why not use the keyboards MUTE key?

  2. Macgiver Says:

    Because then I have to “rewind” back to the point where I left off. With the mute key, the podcast just continues to play silently.

  3. dws Says:

    How about fading out the sound, just before you pause…

    tell application “iTunes”
    activate
    set nOldSoundVolume to sound volume
    repeat with nSoundVolume from sound volume to 0 by -2
    set sound volume to nSoundVolume
    delay 0.1
    end repeat
    pause
    set sound volume to nOldSoundVolume
    end tell

  4. Wayne Says:

    http://lifehacker.com/software/how-to/control-itunes-with-quicksilver-259373.php
    I wonder this is relevant for your usage preference or not. But, I rather amused with the functionality it provides, hit Cmd+Spacebar PP [enter], everywhere works like a charm to pause play iTunes, and more.

Leave a Reply