import subprocess

# Replace "Your Playlist Name" with the exact name of your playlist in the Music app library
playlist_name = "Cool"

# AppleScript to activate shuffle and play a specific playlist
apple_script = f'''
tell application "Music"
    activate
    set shuffle enabled to true
    play playlist "{playlist_name}"
end tell
'''

# Execute the AppleScript
subprocess.run(["osascript", "-e", apple_script])
