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.