Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
@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
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
Hi Laubender,
You are totally right. I just inserted Label with "Label" and it came within the script albel palette
Loic
Copy link to clipboard
Copied
And following this rule, of course the same with extractLabel():
Yes I confirm that. If you type in something within the script label panel and call the line, you get back that value
Copy link to clipboard
Copied
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?
Copy link to clipboard
Copied
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
Copy link to clipboard
Copied
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...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now