- Open Shortcuts app
- Click add new
- in the Search for apps and actions type "dictate text"
- Add it
- in the search type terminal and choose "Run Shell Script"
- 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
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.