Mobile app version of vmapp.org
Login or Join
Kristi927

: Export a single layer as a new document in InDesign If I have 5 layers, can I export one of those layers as a new file, with a new name, in a new location? I currently am using "save

@Kristi927

Posted in: #AdobeIndesign #DocumentSetup #Export #FileFormat

If I have 5 layers, can I export one of those layers as a new file, with a new name, in a new location?

I currently am using "save as" to rename and relocate each layer into 5 new documents.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi927

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ann6370331

Your problem can be solved by scripting it. You can start by this example. What you should add is closing the document and reopening the old one for exporting all of them.

// this script saves the current doc as a new one (with prompt)
// and removes all layers except for the one
// the user chooses in a dropdown
// main function
var main = function() {
// if there is no doc
// abort
if (app.documents.length === 0) {
return;
}

var doc = app.activeDocument; // get the current active doc
var path = doc.filePath; // get the path

var name = prompt("Enter a name"); // get a name
if (name.length === 0) {
// if the user is to lazy add the date
name = (new Date()).toString();
}

var layernames = [];// to store the layer names
// loop the layer array
for (var i = 0; i < doc.layers.length; i++) {
layernames.push(doc.layers[i].name);// get the name
}
// save the doc as a new one
// under the new name
doc.save(new File(path + "/" + name + ".indd"));
// add a small dialog to select the layers
var diag = app.dialogs.add({
name: "Layers",
canCancel: true
});
// needs a column for the dropdown
var column = diag.dialogColumns.add();
// add the dropdown
var layerdd = column.dropdowns.add({
stringList: layernames,
selectedIndex: 0,
minWidth: 75
});
// show the dialog
if (diag.show() === true) {
var ndx = layerdd.selectedIndex;// get the index
diag.destroy(); // remove dialog
// move the layer to top
doc.layers[ndx].move(LocationOptions.AT_BEGINNING);
// remove all other layers
for (var j = doc.layers.length - 1; j >= 1; j--) {
doc.layers[j].remove();
}
}
// THE END
};
main(); // run that thing

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme