For years, I've been using a really simple AppleScript to reset Music's AirPlay device back to my computer. I trigger it using a keyboard shortcut Command + E and the script doesn’t run. Same if I use the pointer to try from the Music → Scripts menu - it doesn’t run.
Here is my script in case that’s the problem :
tell application "Music"
set newAirplayDevice to (get some AirPlay device whose kind is computer)
set current AirPlay devices to {newAirplayDevice}
end tell
Lately (after upgrading to macOS 14, I think) when I trigger it through Music, I get an "AppleEvent timed out" error. However, the script still works as intended when I run it from Script Editor. This limits my ability to troubleshoot. Does this indicate there is a flaw in the script, or is it something in my system configuration?