Script to delete (from playlist and disk) the currently playing OsX Music (uTunes) song
Dec 13, 2021
open “Script Editor” and paste the following
on deleteTrack(trackName)
tell application "Music"
set theTrack to track named trackName of playlist "Library"
set songFile to location of theTrack
delete theTrack
end tell
tell application "Finder" to delete songFile
end deleteTrackon run
tell application "Music"
set currentSong to name of current track
end tell
deleteTrack(currentSong)
tell application "Music"
play
end tell
end run
Save, then run by either clicking “Play” icon, or from the terminal
osascript /Users/yourname/path/to/deletePlayingSong.scpt