7 Replies Latest reply on Oct 22, 2014 7:00 AM by Harbs.

    Using resolve with toSpecifier() output for quick image previews

    DustinMichaels1982

      Hi there,

       

      I am building an image preview service for in design documents in which a user uploads in design file, we extract custom fields, and display a GUI for the user to enter in custom field values to generate a preview.

       

      One of the features of this is highlighting the contents of the custom field last entered. I have the field highlighting working by checking the "contents" property of various table cell and textframes however I thought by using the elements toSpecifier() value I could pass this in the future to select the element quickly.

       

      However I'm getting an error here.

       

      If I use resolve("/document[@id=170]/page[0]/text-frame[4]") I keep getting back a null value.

       

      Am I not using the toSpecifier() value correctly? Is there another function I need to use to resolve a toSpecifier() string value back into an element on the page? Are you only allowed to use the toSpecifier() output value on the current instance of an indesign script? NOTE: I am saving the toSpecifier() value in the DB and using it in future occassions.

       

      Thanks,

       

      Dustin