0

It seems that when InCopy saves a document, programmatically added labels are lost. For instance, if I do this:

app.activeDocument.insertLabel('myLabel', 'magicString');

The label is effectively added, as evidenced by this:

app.activeDocument.extractLabel('myLabel'); // Yields 'magicString'

But if I save, close and reopen the document (all manually), and do:

app.activeDocument.extractLabel('myLabel');

The result is not 'magicString', but ''.

In InDesign, however, after the exact same operations, the result is 'magicString'. Is there any way to make the labels persistant in InCopy?

1 Answers1

0

You should try this way:

app.activeDocument.stories[0].insertLabel('myLabel', 'magicString');

InCopy file is a single story and it seems that story maintains the label better than the document. Then to extract your label you would do:

app.activeDocument.stories[0].extractLabel('myLabel');
Michael
  • 75
  • 9