Skip to content

Instantly share code, notes, and snippets.

@mikeyp
Created January 31, 2022 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mikeyp/9df4c379178c32b14aac6c5ebe4b8648 to your computer and use it in GitHub Desktop.
Save mikeyp/9df4c379178c32b14aac6c5ebe4b8648 to your computer and use it in GitHub Desktop.
Control Tidal with Hammerspoon
local function togglePlayPause()
hs.applescript([[
tell application "System Events"
tell process "TIDAL"
click menu item 0 of menu "Playback" of menu bar 1
end tell
end tell
]])
end
local function nextTrack()
hs.applescript([[
tell application "System Events"
tell process "TIDAL"
click menu item "Next" of menu "Playback" of menu bar 1
end tell
end tell
]])
end
local function previousTrack()
hs.applescript([[
tell application "System Events"
tell process "TIDAL"
click menu item "Previous" of menu "Playback" of menu bar 1
end tell
end tell
]])
end
local module = {
togglePlayPause = togglePlayPause,
nextTrack = nextTrack,
previousTrack = previousTrack
}
return module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment