There's a WindowNames function that will return a list of the names of all open windows.
Set Window Title can be used to rename an existing window. I sometimes use this step to rename the initial window so that it does not show the name of the file.
That works, after I set the script trigger to "OnFirstWindowOpen" in File Options/Switch to Layout. I assume that's how you do it.
Thanks for the help.