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

Using a Script to access InDesign’s DataMerge fields : InDesign Scripting

Return to Member Forum

  • Author
    Posts
    • #14388748
      Austin
      Member

      I’m trying to work on making a script to automate a portion of our work flow and trying to access the content being loaded in via the Data Merge Function. My hope is to be able to access the names of the fields that are loaded in, and then access the items within that field, however i’m having no luck with the script recognizing names of fields. what ive tried is:

      app.activeDocument.dataMergeProperties.dataMergeFields.count() – this returns the correct number of fields loaded in
      app.activeDocument.dataMergeProperties.dataMergeFields.item[0] – this returns as undefined, and is not an object
      app.activeDocument.dataMergeProperties.dataMergeFields.toSource() – this returns ‘resolve(“/document[@id=23]/@data-merge-properties/data-merge-field”)’
      app.activeDocument.dataMergeProperties.dataMergeFields[0] – this returns [object DataMergeField]

      I’m referencing indesignjs.de but so far has not cleared things up, any help would be appreciated!

    • #14388749
      Austin
      Member

      i got to the field name with:
      app.activeDocument.dataMergeProperties.dataMergeFields[0].fieldName

      so now just to figure out if i can access the data within the field!

    • #14388754
      David Blatner
      Keymaster

      We have a few scripters who read here sometimes, but you might get even more help at the InDesign Scripting group on FB: https://www.facebook.com/groups/indesignscripting

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