dustinrue / ControlPlane

ControlPlane - context-sensitive computing for OS X
http://www.controlplaneapp.com
BSD 3-Clause "New" or "Revised" License
1.76k stars 180 forks source link

How to use ControlPlace to pause Spotify while in a Meeting? #502

Open ssbarnea opened 5 years ago

ssbarnea commented 5 years ago

One very useful use-case would be to pause Spotify playing while you are in a meeting.

I would measure "being in a meeting" as having an application running, in my case BlueJeans. When this application is running I want to tell Spotify to pause.

Optionally I would like to resume it when the meeting application is quit.

mikew commented 5 years ago

Seems like this is already possible with the existing "Running Application" evidence source paired with this shell script

#!/usr/bin/env bash

osascript -e 'tell application "Spotify" to playpause'

Script taken from here: https://github.com/hnarayanan/shpotify