System Events + Music + Import Playlists
Hello, I'm attempting to import playlists into Music using Applescript System Events. This is as far as I've got:
tell application "System Events"
tell process "Music"
set frontmost to true
click menu item "Import Playlist…" of menu "Library" of menu item "Library" of menu "File" of menu bar item "File" of menu bar 1
end tell
end tell
This displays the Open dialog but I can't work out how to process each of the playlists that are now displayed. I've downloaded the Accessibility Inspector and I think I might need to work with the AXGroup and Index in some sort of Repeat routine, but I can't put it together. Can I somehow go from Index 0 through to however many playlists I've got in that folder using the AXGroup list?
Thanks.