Hello, I have a big problem ...
I have an InDesign book composed of approx. 120 documents Indesign.
My question: Did you know a script able to delete unused nuances in every document composing a book rather than to make it document by document (120 documents) by the menu of the color swatches.
Not a requirement I've come across earlier, but it doesn't sound too hard.
for (var i=0; i<app.books.bookContents.length; i++)
var currentDoc = app.open (app.books.bookContents[i].fullName, true);
for (var j=currentDoc.unusedSwatches.length; j > 0; j--)
This script assumes you have your one (and only one!) Book on screen. It opens each of the Book documents one by one, removes the swatches, and closes it again.
There has always been some disagreement on what makes a swatch "unused", and I'm assuming this works the same as it does in the User Interface -- it removes what's possible and leaves the rest.