Choosing book layers to output for Print/PDF
I produce several multi-language books & brochures that consists of up to 114 separate documents linked via a Book file. Each language has its' own layer with the same name in all documents while other layers are exclusive to, or only exist in some documents. Currently when I have to Print or create a PDF of a specific language I have to open every single document to activate the layers I want visible, save, and then proceed to output the entire book.
I would like to propose that Indesign incorporate an additional tab in its' print/pdf dialog boxes that lists ALL layers across all documents selected and allows the user to choose via a checkbox which layers are to be output.
Furthermore I'd like to suggest layers with the same name work similar to how the Links dialog works where I could select the top-most label to output all layers with the same name -OR- have a drop down that lists the documents that layer name is found in & allows me to select which ones I want output or not.
Additionally, I would like to be able to SAVE active layer settings so they can be reloaded rather than having to re-indicate which layers need to be activated/deactivated again when I go to reprint any particular language. This of course will likely require an indicator if available layers have changed within any of the selected files within the book.
This would save a tremendous amount of time & effort especially when a change occurs across all languages requiring I output the entire book for each language. Currently having to open, activate/deactivate layers, & re-save every document for each language I need to output is extremely time consuming & ridiculous.
Thank you in advance for your consideration. I truly hope you will choose to implement this suggestion.
Respectfully,
Len Zigante
-
Andre commented
InDesign's index feature has the option, when generating the index, to include entries from all other documents in the same book. That's what's really needed here - a similar checkbox in the layers panel that shows all layer groups in the book, with changes applying across all documents.
In the meantime, the below script might help, I wrote it with ChatGPT (and having tested it, can confirm it works):
var book = app.activeBook;
var bookDocs = book.bookContents;
var layerToKeepVisible = "LayerName"; // Change this to the layer you want to remain visiblefor (var i = 0; i < bookDocs.length; i++) {
var docPath = bookDocs[i].fullName;
var doc = app.open(File(docPath));
try {
var layers = doc.layers;
for (var j = 0; j < layers.length; j++) {
var layer = layers[j];
var wasLocked = layer.locked; // Store original locked state
layer.locked = false; // Unlock it to change visibilityif (layer.name != layerToKeepVisible) {
layer.visible = false;
} else {
layer.visible = true;
}layer.locked = wasLocked; // Restore original locked state
}
} catch (e) {
alert("Error in document: " + doc.name + "\n" + e.message);
}
doc.save();
doc.close(SaveOptions.YES);
}alert("All layers except '" + layerToKeepVisible + "' have been hidden in all book documents, including locked layers.");
-
Mattias Olofsson commented
Hi Len.
Have you found a solution to this?
I have the same problem.Best regards Mattias