Skip to content

Instantly share code, notes, and snippets.

@ggada
Created April 2, 2019 00:01
Show Gist options
  • Save ggada/c17022fa39ccb567f1601721c221bacf to your computer and use it in GitHub Desktop.
Save ggada/c17022fa39ccb567f1601721c221bacf to your computer and use it in GitHub Desktop.
iTunes replacement for YouTube Music
#!/usr/bin/env osascript
tell application "System Events"
tell process "Google Chrome"
set frontmost to true
perform action "AXRaise" of window 1
keystroke "0" using {shift down, command down}
end tell
end tell
@ggada
Copy link
Author

ggada commented Apr 2, 2019

cd /Applications/iTunes.app/Contents/MacOS
sudo mv iTunes iTunesX
sudo curl -o iTunes https://gist.githubusercontent.com/ggada/c17022fa39ccb567f1601721c221bacf/raw/fdd17bdf8704979021135dfdcbf8b90953aa05c5/iTunes
sudo chmod uog+x iTunes

Install Streamkeys
Goto chrome://extensions/shortcuts
Configure Toggle play/pause in the Streamkeys shortcuts as Command + Shift + 0 (zero)
Go to System Preferences, Security and Privacy and allow iTunes to control your computer (needed for AxRaise).

Now Play/Pause will Play/Pause YouTube Music.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment