Skip to content

Instantly share code, notes, and snippets.

@julien
Created April 11, 2025 22:38
Show Gist options
  • Save julien/bccca4cbd49a8174da183d692d9f5ac6 to your computer and use it in GitHub Desktop.
Save julien/bccca4cbd49a8174da183d692d9f5ac6 to your computer and use it in GitHub Desktop.
Prevent Music.app from launching automatically on macOS
-- usage: osascript nomusic.scpt
-- prevent Music.app from launching (semi-randomly).
-- stupid solution to fix this stupid behaviour:
-- loop forever and if we detect that Music.app
-- is running we "quit" it, the ideal solution would
-- be to able to remove all those defaults .apps ...
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
repeat while true
set mRunning to is_running("Music")
if mRunning then
tell application "Music"
quit
end tell
end if
end repeat
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment