Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to remove custom labels?

Explorer ,
Jul 21, 2009 Jul 21, 2009

I would like to delete a custom label (created with insertlabel) but can't find it anywhere in the much aplauded Adobe documentation .

I am able to delete the label values, but I want to get rid of the keys as well. I normally clean up documents before delivery, including removal of all artefacts and working materials like notes, lowres images and... labels.

How to delete a custom label?

TOPICS
Scripting
1.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 21, 2009 Jul 21, 2009

This is an entirely different kind of label than the ones I'm used to (the Label property), but some experimenting shows you can 'extract' just about any key you want -- it doesn't give an error if the key is not defined, it just returns an empty string.

So at least setting the label to an empty string using insertLabel will remove the data part.

Whether or not the key name is still in your document, who knows? Custom labels should be preserved along INX and IDML exports, so you can export a test document and check the resulting file.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 21, 2009 Jul 21, 2009

Thanks Jongware, I assume that if you don't know it, it's simply not implemented.

You're also right that it's not the Label property, but it's a helpful feature anyway. I expected it to have Labels.Count etc. but obviously we're left in the dark a bit. Concluding: there is no way to test whether a certain Custom Label exists or not. We can only Extract it's value - if the result is empty we must pretend it's not there.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 27, 2010 Jan 27, 2010

Hi, Tony!

I found that the private label is indeed stored in a IDML file. For example a label set by

app.activeDocument.insertLabel("Uwe","Laubender");

is stored in the designmap.xml part of the IDML file:

<Properties>
        <Label>
            <KeyValuePair Key="Uwe" Value="Laubender"/>
        </Label>
    </Properties>

You can strip those labels from the IDML by deleting the above properties.

Uwe

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Mar 11, 2010 Mar 11, 2010
LATEST

Thanks for your answer, much appreciated.

Does this mean I should first save as indx, edit the xml and then re-open/save as indd?

It strikes me that nobody worries about cleaning up their waste after they're done. Why not a "CustomLabels.Count"...

But thanks anyway!

Tony.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines