This is what I came up with, for the moment. It gathers ranges of Master names and inserts them on a page of their own at the end of your current document. No color labels so far, because there is no immediate connection between UIColors (Salmon, Gold) and RGB colors, so these would have to be converted one by one. Still, it's a start.
(I didn't realize when writing the script, but the very final [None] entry is, of course, the page the script adds.)
endPage = app.activeDocument.pages.add(LocationOptions.AT_END);
endPage.appliedMaster = null;
someFrame = endPage.textFrames.add ({geometricBounds:[endPage.bounds[0]+endPage.marginPreferences.top, endPage.bounds[1]+endPage.marginPreferences.left, endPage.bounds[2]-endPage.marginPreferences.bottom, endPage.bounds[3]-endPage.marginPreferences.right]});
text = [];
currentPage = 0;
nextPage = currentPage;
while (nextPage < app.activeDocument.pages.length)
{
currentMaster = app.activeDocument.pages[currentPage].appliedMaster;
while (nextPage < app.activeDocument.pages.length)
{
if (app.activeDocument.pages[nextPage].appliedMaster != currentMaster)
break;
nextPage++;
}
if (currentMaster == null)
name = “[None]”;
else
name = currentMaster.name;
if (currentPage == nextPage-1)
text.push (“P.: “+app.activeDocument.pages[currentPage].name+”: “+name);
else
text.push (“Pp: “+app.activeDocument.pages[currentPage].name+”-“+app.activeDocument.pages[nextPage-1].name+”: “+name);
currentPage = nextPage;
}
someFrame.contents = text.join(“r”);