Skip to content

Instantly share code, notes, and snippets.

@cristopher-rodrigues
Last active November 28, 2022 12:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cristopher-rodrigues/a6ff9e453a6b42fb702b8c3299724ba7 to your computer and use it in GitHub Desktop.
Save cristopher-rodrigues/a6ff9e453a6b42fb702b8c3299724ba7 to your computer and use it in GitHub Desktop.
Siri Play Spotify Shortcut
  1. Open Shortcuts app
  2. Click add new
  3. in the Search for apps and actions type "dictate text"
  4. Add it
  5. in the search type terminal and choose "Run Shell Script"
  6. paste the following:
osascript -- - "$1" <<'EOF'
on run(argv)

tell application "Spotify"
activate
tell application "System Events"
keystroke "l" using command down
keystroke "a" using command down
keystroke argv
delay 1
key down return
delay 0.1
keystroke (ASCII character 9)
delay 0.1
key up return
keystroke (ASCII character 9)
keystroke return
end tell
end tell

end
EOF

image

@WyAug
Copy link

WyAug commented Nov 28, 2022

It doesn't work accurately. It only opens Spotify but doesn't play any music.
We can command Siri normally to open Spotify on mac.

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