I have a simple script that automates the command "Export Library" in Music. It does the following:
tell application "System Events"
tell process "Music"
set libmenu to menu item "Library" of menu "File" of menu bar 1
click menu item "Export Library…" of menu of libmenu
tell window 1
click button "Save"
tell sheet 1 to click button "Replace"
end tell
end tell
end tell
(So basically it opens the menu and clicks the obvious buttons, saving me a few clicks). However, after upgrading to Ventura (macOS 13.0), this stopped working. The command click button "Save"
is failing with:
Can’t get button \"Save\" of window 1 of process \"Music\"."
I tried to say click button 1
or click button 2
instead, but that doesn't work. I then said name of every button
and it printed
{missing value, missing value, missing value}
I couldn't find a good manual for AppleScript, but it does look like something changed in Ventura. Any hints will be appreciated!
Thanks,