Skip to main content
Inspiring
March 2, 2015
Question

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

  • March 2, 2015
  • 2 replies
  • 911 views

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?

This topic has been closed for replies.

2 replies

Inspiring
March 3, 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?

Loic.Aigon
Legend
March 3, 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

Loic.Aigon
Legend
March 2, 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

Community Expert
March 2, 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

Loic.Aigon
Legend
March 2, 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


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