Open steve228uk opened 6 years ago
+1
my workaround so far is to control the applications internal shortcuts by "system events" key code command. its not perfect and appears a bit glitchy because the script needs to quickly switch the application in order to execute the "system events" command and then returns to the previous window, nevertheless its working. see the example below:
apple-script
tell application "System Events" set frontmostApplicationName to name of 1st process whose frontmost is true end tell
tell application "YT Music" to activate tell application "System Events" key code 49 end tell
tell application frontmostApplicationName activate end tell
for apple key codes look here: https://eastmanreference.com/complete-list-of-applescript-key-codes. its important to compare the POSITION of the key on your real keyboard if it is not the same as in the example shown.
cheers bendsch
I make the Sleepytime Mac app (a sleep timer with support for multiple music players) and I've received a request to add support for YT Music, however I can't do that unless YT Music exposes an AppleScript interface. Controlling the app using system events scripting like @bendschs suggested is not reliable enough for a seamless integration in another app like mine. +1 from me.
I might consider contributing this feature to YT Music given a few hints about the codebase (fire away) but I currently have no time for that. Just leaving this here.
Add a dictionary to retrieve song info and control the media via Apple script.