AppleScript to playpause active media player

So I recently wrote an AppleScript to control Spotify (tell application "Spotify" to playpause) with my Apple EarPods. But unfortunately, that will only make Spotify playpause. I was wondering if there was a way to modify my script so that my active/most recent media player will playpause (like "tell system to playpause"); similar to how on iOS clicking the EarPods will control my most recent media app.

MacBook Pro, Mac OS X (10.7.3), AppleScript

Posted on May 26, 2013 8:42 AM

Reply
3 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

AppleScript to playpause active media player

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.