Skip to content
Fabian Morón Zirfas edited this page Jun 13, 2025 · 2 revisions

You can make use of scripting labels to save information in your files that can be accesed later on by a script.

// create a new doc
var doc1 = app.documents.add();
// add a label
// everything can have a scripting label
// textFrames, ovals, pages, swatches ...
doc1.label = "foo";
// save the file
doc1.save(new File("~/Desktop/doc1.indd"));
// export the idml file
doc1.exportFile(
	ExportFormat.INDESIGN_MARKUP,
	new File("~/Desktop/doc1.idml"),
	false,
);
// close the first document
doc1.close();
// open the idml file
var doc2 = app.open(File("~/Desktop/doc1.idml"));
// read the label
$.writeln(doc2.label);

Home

Clone this wiki locally