Playlist Windows
iTunes 12.6 has brought back Playlist windows and, judging from the reaction in my Twitter feed, they're receiving a hearty welcome back. Couple of things, though: 1) The names of the open Playlist windows are not listed in the iTunes "Window" menu and 2) window names are blank for any Apple Music playlists opened as Playlist windows; they actually default to the name "iTunes" but this isn't displayed either To be clear, the AppleScript name for the window of a subscription playlist is "iTunes" and not the name of the playlist. (Update: And now I'm not seeing this at all and all seems correct as far as names go; don't know what I was seeing previously!)
I'm not so much concerned about the latter thing. But if you have a batch of Playlist windows open it can be an ordeal to select one you'd like to work in. This script will list all open Playlist windows in a choose from list panel so one can be chosen and then made frontmost:
tell application "iTunes"
if (count of playlist windows) < 2 then return
set windowList to playlist windows
set nameList to name of view of playlist windows
try
set chosenName to (choose from list nameList)
if chosenName is false then error
on error
return
end try
set chosenName to (chosenName as text)
repeat with i from 1 to (count of nameList)
if chosenName is item i of nameList then select item i of windowList
end repeat
end tell
Click on the little AppleScript icon above to open the script in Script Editor at your house—don't copy the text in the browser.
Save the script as a compiled Script (".scpt") with Script Editor named whatever you like in your [home]/Library/iTunes/Scripts/ folder. When there are too many Playlist windows open and you can't find any real estate to click on, launch the script to select the one you want brought to the front.
(Update: Of course, after I post this I immediately discovered that you can Command-tilde (~) through open Playlist windows.)