Rather than rewriting scripts at runtime, keep separate copies of scripts for iTunes and scripts for apple Music and decide which script to use at runtime.
Tested on Catalina with initial values of process.player set to each of "Music", "iTunes", and "x".
Rather than rewriting scripts at runtime, keep separate copies of scripts for iTunes and scripts for apple Music and decide which script to use at runtime.
Tested on Catalina with initial values of
process.player
set to each of"Music"
,"iTunes"
, and"x"
.