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

How to store metadeta information in IDMS (Indesign snippets) ?

Participant ,
Mar 02, 2015 Mar 02, 2015

Hi,

I know there is a way to store the custom data into document using document meta data preferences.

But, I am exporting a IDMS by selecting some frames from my page, and I need to store some custom information into that IDMS, is this possible?

Can someone suggest a way to achieve that?

TOPICS
Scripting
887
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
People's Champ ,
Mar 02, 2015 Mar 02, 2015

Hi Kapoor,

You can either add the "metadata" in a form of a label prior to export the object as idms. Given that sel is your object to export :

sel.label = "myLabel" //will display label in the script label palette

//or

sel.insertLabel ( "idms", "myLabel" );//Insert the label within the object

If you want to insert the label later when idms have already been exported, you can open eand edit the files As IDMS are just editable XML files :

<Label>

  <KeyValuePair Key="Label" Value="Cyan" />

  </Label>

Weirdly the IDMS syntax for adding or inserting a label seems to be identical. I couldn't see where InDesign is told to display the label in the script label panel in this case.

FWIW,

Loïc

http://www.ozalto.com

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 ,
Mar 02, 2015 Mar 02, 2015

@Loïc – I think the difference is using the special key value string "Label" of the KeyValuePair attribute of the tag <Label> in IDML/IDMS.

<Label>

    <KeyValuePair Key="Label" Value="MyValue"/>

</Label>

So it seems to be wise not working with a key string like "Label" when working with the method insertLabel(), if you want to hide the value from the user.

myRectangle.insertLabel("Label","MyValue");

Is the same as:

myRectangle.label = "MyValue";

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
Community Expert ,
Mar 02, 2015 Mar 02, 2015

And following this rule, of course the same with extractLabel():

myRectangle.extractLabel("Label");

will fetch the value of myRectangle.label, if there is any.

If there is none, an empty string will returned.

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
People's Champ ,
Mar 02, 2015 Mar 02, 2015

Hi Laubender,

You are totally right. I just inserted Label with "Label" and it came within the script albel palette

Loic

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
People's Champ ,
Mar 02, 2015 Mar 02, 2015

And following this rule, of course the same with extractLabel():

  1. myRectangle.extractLabel("Label"); 

Yes I confirm that. If you type in something within the script label panel and call the line, you get back that value

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
Participant ,
Mar 03, 2015 Mar 03, 2015

hi everyone, thanks for the info, that will be one way to store the info.

But, inserting the the label makes the information very particular to that frame/group.

Is there a more generic way to store the custom information in IDMS?

If we open the IDMS file(it's in XML format), we can see that it has XMP nodes added at the end which store document info etc.

Is there a way to form the IDMS as an object and insert some custom nodes before it gets exported as actual 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
People's Champ ,
Mar 03, 2015 Mar 03, 2015

Hi,

I think it's likely that the IDMS file will be interpreted while imported and that any node which is not one of the IDMS specification will be discarded. I think that in this case, you may need to read the node info prior to import the snippet.

On a second thought you could add a dummy item with an inner label which can be made of XML and then once imported, read at that label, process the infos and then remove the dummy item. But it's propably more work than read the idms info prior to injection.

Hopefully someone has a better idea ?

Loic

http://www.ozalto.com

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
LEGEND ,
Mar 03, 2015 Mar 03, 2015
LATEST

You can add extra XML elements and attributes to IDMS. As long as the structure and necessary comments are intact, InDesign ignores everything else.

So, while InDesign will not store anything in the IDMS for you (except labels), you can easily modify the IDMS file after the export.

FWIW, you can add labels to any object which ends up in the IDMS files. This includes styles, swatches and what-have-you...

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