Back

If your email is not recognized and you believe it should be, please contact us.

  • You must be logged in to reply to this topic.Login

Populate metadata fields by tagging text or paragraph style?

Return to Member Forum

  • Author
    Posts
    • #60468
      Anonymous
      Inactive

      Hi all

      So we're a big magazine publisher, all our pages are converted to PDF and made available online to subscribers and internally through our intranet.

      We currently manually enter metadata for Title, Description and keywords. But the title is usually the page headline, the description usually the standfirst. I know 'usually' is a big word, but let's assume it's always the case unless we manually change it through Document Info.

      It would be outstanding to autofill these fields somehow with headline and standfirst text – maybe by tagging the text, or telling InDesign to use the paragraph style.

      Any ideas gratefully received.

      Mike

    • #60489
      David Goodrich
      Participant

      I'd be interested in something like this, too. Part of the trouble with XMP metadata is it's so subtle that just remembering to insert and proof it isn't easy. I'd love to automagically insert Title and Author from paragraph styles for same, and I could see a non-printing element on opening pages where I could put and view the Keywords going into XMP.

      Unfortunately, XMP metadata doesn't come up very often over on Adobe's InDesign forum, but I notice that today there is this thread<https://forums.adobe.com/thread/786176?tstart=0&#62;, albeit on a different aspect. That's enough to suggest scripting is the way to go, in which case it should be worth looking in on Adobe's InDesign Scripting forum. There the granddaddy of InDesign scripting, Olav Kvern, pointed in the general direction in this thread<https://forums.adobe.com/thread/541175&#62; from late 2009. Given the forums' limited searching capability, you might want to Google<[terms you want to search on] “InDesign Scripting > Discussions” site:forums.adobe.com/thread/>.

      Good luck,
      David

    • #60490
      David Goodrich
      Participant

      I should have remembered the Tomaxxi plug-in for IDCS5 that simplifies copy-and pasting between ID text and the XMP metadata. I confess I haven't actually tried it yet — I skipped IDCS5 and I'm still just testing with IDCS5.5.

      David

    • #60628
      Anonymous
      Inactive

      When we upgrade, that will be a big help. In the meantime, it's still CS3 for us…

      Mike

    • #60657
      David Goodrich
      Participant

      I wrote a crude little Javascript that copies the contents of paragraphs marked with four unique paragraph styles into the Title, Author, Subject (a.k.a. Description) and Keywords categories. I decided not to copy actual text from the article because I usually need to edit it for the metadata: an article's title often includes forced line breaks, and there may be a sub-title set in a separate paragraph style; or there may be phrases in italics, which I need to enclose in quotes for formatless metadata. So I make a non-printing text frame in the margin on the opener, where I prepare the stuff I want to go into the XMP metadata.

      It works in IDCS4, but I assume it wouldn't be hard to write something similar for IDCS3. I don't recall whether Style Groups came in with CS4, but I used them, irritating as they can be. The one bit of subtlety was using an array for keywords which made it convenient to separate my keywords with commas in my text box and still get fed properly into XMP. No error checking — the script dies if it can't find an instance of a paragraph style, and I don't know what happens if there are two. I'll paste my script below in case anyone wants to play with it. I hope the big boys will excuse my noob oversights.

      David

      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;
      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item(“XMP_Basic4”).paragraphStyles.item(“Title”);
      app.findGrepPreferences.findWhat = “r”;
      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item(“XMP_Basic4”).paragraphStyles.item(“Author”);
      app.findGrepPreferences.findWhat = “(?<=^).+(?=$)”;
      app.activeDocument.metadataPreferences.author = app.findGrep()[0].contents;

      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;
      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item(“XMP_Basic4”).paragraphStyles.item(“Title”);
      app.findGrepPreferences.findWhat = “(?<=^).+(?=$)”;
      app.activeDocument.metadataPreferences.documentTitle = app.findGrep()[0].contents;

      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;
      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item(“XMP_Basic4”).paragraphStyles.item(“Description”);
      app.findGrepPreferences.findWhat = “(?<=^).+(?=$)”;
      app.activeDocument.metadataPreferences.description = app.findGrep()[0].contents;

      MyKeywordsPara = ” “;
      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;
      app.findGrepPreferences.appliedParagraphStyle = app.activeDocument.paragraphStyleGroups.item(“XMP_Basic4”).paragraphStyles.item(“Keywords”);
      MyKeywordsPara = app.findGrep()[0].contents;
      app.activeDocument.metadataPreferences.keywords = MyKeywordsPara.split(“,”)

      app.findGrepPreferences = NothingEnum.nothing;
      app.changeGrepPreferences = NothingEnum.nothing;

Viewing 4 reply threads
  • The forum ‘General InDesign Topics (CLOSED)’ is closed to new topics and replies.
Forum Ads