Skip to content

Instantly share code, notes, and snippets.

@XSAM
Last active May 8, 2023 12:36
Show Gist options
  • Save XSAM/f892974da3bde281cf7f58f49539ba6a to your computer and use it in GitHub Desktop.
Save XSAM/f892974da3bde281cf7f58f49539ba6a to your computer and use it in GitHub Desktop.
Control Netease Music via AppleScript
tell application "System Events" to tell process "NeteaseMusic"
tell menu bar 1
tell menu bar item "Controls"
tell menu 1
if menu item "Play" exists then
click menu item "Play"
display notification "Play Music" with title "NeteaseMusic"
else
click menu item "Pause"
display notification "Pause Music" with title "NeteaseMusic"
end if
end tell
end tell
end tell
end tell
display notification "df" with title "NeteaseMusic" sound name "default"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment