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

Add metadata to individual page items?

Guest
Feb 09, 2017 Feb 09, 2017

Copy link to clipboard

Copied

We are using InDesign as part of a publishing workflow for a mobile publishing app. Each page element (e.g. Page, Image, Textbox) needs to be tagged with a unique identifier (a UUID), which we then export along with the document structure into a JSON file. We need to make sure that the UUID for each element, once set, doesn't change when the document is re-exported.

Currently we have to save the identifiers in a separate file, and then merge them into our JSON as a second step. This is an unwieldy and error-prone approach. Is there any way that metadata for individual pages / page items can be saved directly into an InDesign document (and subsequently queried) through javascript? Any suggestions would be greatly welcome!

TOPICS
Scripting

Views

426

Translate

Translate

Report

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
Guru ,
Feb 12, 2017 Feb 12, 2017

Copy link to clipboard

Copied

Is not that what the id property about?

In what form are you exporting the pages?

Votes

Translate

Translate

Report

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 ,
Feb 12, 2017 Feb 12, 2017

Copy link to clipboard

Copied

Hi Trevor,

I'm not sure, but I guess the workflow of the OP is Export to EPUB or HTML.

And unfortunately the ids that are created during the export process have nothing in common with the ids for page items we see in an InDesign document.

One example showing exported IDs for e.g. Publish Online HTML:

German InDesign:

<div id = "_idContainer000" class="Einfacher-Textrahmen"

English InDesign:

<div id = "_idContainer000" class="Basic-Text-Frame"

And is not following InDesign's pageItem id numbering and object naming system.

( Perhaps an added underscore is useful for some JavaScript operations on strings?! so I left the underscore notation alone )

Made up scheme:

<div id = "_356" class="TextFrame"

For some objects that hold transparency even new objects are created that never existed in the InDesign document.
It's hard to foresee what survives how when exported and if e.g. tagging with e.g. alt text would go unaltered through the workflow.

Regards,
Uwe

Votes

Translate

Translate

Report

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
Feb 13, 2017 Feb 13, 2017

Copy link to clipboard

Copied

LATEST

I think I've figured this out now - the "label" property does what we need. I can set a metadata value programmatically by selecting an item (e.g. text frame)

app.selection[0].label = 'some label';

And we can confirm the value in the InDesign GUI by selecting the labeled object and clicking on Window > Utilities > Script Label.

If we use comma separated values, we can store multiple items of metadata here.

Votes

Translate

Translate

Report

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