I would like to programmatically get the titles that appear at the top of notebook windows, particularly for notebooks that have not yet been saved (if they have been saved, I can get the information I am after by taking the correct Part of NotebookFileName[NotebookObjectOfInterest]). For example, in a session where a Message notebook has been produced by the front end, I would like to do operations on this notebook. The problem is that Notebooks[] returns a randomly-ordered (as far as I can tell) list of all open notebooks, and I don't know how to specify the one corresponding to Messages. The notebook objects themselves seem to know about their titles, as when you evaluate Notebooks[], the NotebookObjects that result display their titles when rendered as an output cell (and I can even see the corresponding text when I perform CTRL-SHFT-e on this cell), but I cannot for the life of me determine how to get at this information programmatically (Evaluating Notebooks[] // FullForm returns a list of NotebooksObjects where the human-readable titles are not accessible). As a bonus, I would also like to be able to determine if the notebook has been saved since its last modification (corresponding to the "*" that appears on the titlebar of notebooks with unsaved modifications. Currently, I can determine if a notebook has been saved at least once (by calling NotebookFileName on it and testing for $Failed), but don't know how to test for the most recent modification time.
Final point of attack: is there a way to see the cell expression that WOULD be produced by an evaluation without having the front end actually produce the cell? That would get me most of the way towards a solution (though it would be inelegant and require pattern matching the cell expression produced by Notebooks[]).
Thanks!
WindowTitle /. AbsoluteOptions /@ Notebooks[]
$\endgroup$