Skip to content

Instantly share code, notes, and snippets.

@msongz
Created March 2, 2020 13:31
Show Gist options
  • Save msongz/c7982e5317ab566dfdfd7ba80b88c52a to your computer and use it in GitHub Desktop.
Save msongz/c7982e5317ab566dfdfd7ba80b88c52a to your computer and use it in GitHub Desktop.
spotify global shortcut key to play/pause/next/previous with keyboard maestro
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>604848114.02842605</real>
<key>CustomIconData</key>
<string>KMEP-GenericApplication-/Applications/Spotify.app</string>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>DisplayKind</key>
<string>Window</string>
<key>HonourFailureSettings</key>
<true/>
<key>IncludeStdErr</key>
<false/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Source</key>
<string>Nothing</string>
<key>Text</key>
<string>osascript -e 'tell application "Spotify" to previous track';</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<true/>
<key>TrimResultsNew</key>
<true/>
<key>UseText</key>
<true/>
</dict>
</array>
<key>CreationDate</key>
<real>604847931.34480298</real>
<key>CustomIconData</key>
<string>KMEP-Left</string>
<key>ModificationDate</key>
<real>604848246.80227005</real>
<key>Name</key>
<string>spotify previous</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>123</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>2304</integer>
</dict>
</array>
<key>UID</key>
<string>CD01E4DA-22F8-4737-90D8-40670F8473CE</string>
</dict>
</array>
<key>Name</key>
<string>spotify</string>
<key>ToggleMacroUID</key>
<string>14BAE4E1-F7C1-4EF6-B43C-302B72F02564</string>
<key>UID</key>
<string>37137C8B-5F8F-418A-85AD-47897EC970D6</string>
</dict>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>604848114.02842605</real>
<key>CustomIconData</key>
<string>KMEP-GenericApplication-/Applications/Spotify.app</string>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>DisplayKind</key>
<string>Window</string>
<key>HonourFailureSettings</key>
<true/>
<key>IncludeStdErr</key>
<false/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Source</key>
<string>Nothing</string>
<key>Text</key>
<string>state=`osascript -e 'tell application "Spotify" to player state as string'`;
if [ $state = "playing" ]; then
osascript -e 'tell application "Spotify" to pause';
fi;
if [ $state = "paused" ]; then
osascript -e 'tell application "Spotify" to play';
fi</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<true/>
<key>TrimResultsNew</key>
<true/>
<key>UseText</key>
<true/>
</dict>
</array>
<key>CreationDate</key>
<real>604847989.51879299</real>
<key>CustomIconData</key>
<string>KMEP-iTunesPause</string>
<key>ModificationDate</key>
<real>604848258.50885201</real>
<key>Name</key>
<string>spotify play/pause</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>125</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>2304</integer>
</dict>
</array>
<key>UID</key>
<string>E33A8BF4-2936-4D65-894E-09DFCC23B047</string>
</dict>
</array>
<key>Name</key>
<string>spotify</string>
<key>ToggleMacroUID</key>
<string>14BAE4E1-F7C1-4EF6-B43C-302B72F02564</string>
<key>UID</key>
<string>37137C8B-5F8F-418A-85AD-47897EC970D6</string>
</dict>
<dict>
<key>Activate</key>
<string>Normal</string>
<key>CreationDate</key>
<real>604848114.02842605</real>
<key>CustomIconData</key>
<string>KMEP-GenericApplication-/Applications/Spotify.app</string>
<key>Macros</key>
<array>
<dict>
<key>Actions</key>
<array>
<dict>
<key>DisplayKind</key>
<string>Window</string>
<key>HonourFailureSettings</key>
<true/>
<key>IncludeStdErr</key>
<false/>
<key>MacroActionType</key>
<string>ExecuteShellScript</string>
<key>Path</key>
<string></string>
<key>Source</key>
<string>Nothing</string>
<key>Text</key>
<string>osascript -e 'tell application "Spotify" to next track';</string>
<key>TimeOutAbortsMacro</key>
<true/>
<key>TrimResults</key>
<true/>
<key>TrimResultsNew</key>
<true/>
<key>UseText</key>
<true/>
</dict>
</array>
<key>CreationDate</key>
<real>604839721.11516905</real>
<key>CustomIconData</key>
<string>KMEP-Right</string>
<key>ModificationDate</key>
<real>604848233.573125</real>
<key>Name</key>
<string>spotify next</string>
<key>Triggers</key>
<array>
<dict>
<key>FireType</key>
<string>Pressed</string>
<key>KeyCode</key>
<integer>124</integer>
<key>MacroTriggerType</key>
<string>HotKey</string>
<key>Modifiers</key>
<integer>2304</integer>
</dict>
</array>
<key>UID</key>
<string>19820FA6-5312-473C-9E8A-BA66A8DA5967</string>
</dict>
</array>
<key>Name</key>
<string>spotify</string>
<key>ToggleMacroUID</key>
<string>14BAE4E1-F7C1-4EF6-B43C-302B72F02564</string>
<key>UID</key>
<string>37137C8B-5F8F-418A-85AD-47897EC970D6</string>
</dict>
</array>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment