5 Replies Latest reply on Jan 31, 2010 12:21 PM by scriptworker

    Store data in a word or text range

    scriptworker Level 1

      Hello scripters,

       

      What I need to do is store data in a word or a range of text.

      With pageItems there is the insertLabel method. There is

      no method like this for text. Does anyone have an idea if

      this can be done, or can someone give a hint?

       

       

      Michel

        • 1. Re: Store data in a word or text range
          AdobeScripts Level 3

          scriptworker wrote:

           

          What I need to do is store data in a word or a range of text.

          With pageItems there is the insertLabel method. There is

          no method like this for text. Does anyone have an idea if

          this can be done, or can someone give a hint?

          No - it can't be done.

          But you can use XML to tag text and set your data as XMLAttribute.

           

          robin

          www.adobescripts.com

          • 2. Re: Store data in a word or text range
            L. Guy O'Rojo Level 2

            Hi:

             

            I wanted that too, but it's not possible. (I talked to some Adobe engineers directly.)

             

            There are some extremely goofy workarounds possible, such as tacking on a couple of spaces to a paragraph and specifying unique tracking or kerning values (to make an ID number equivalent) or creating and assigning a bunch of uniquely named swatches which are all equivalent to 100% black, but none of these techniques are very practical or easy.

             

            You'd think that they could implement this because they keep track of a lot of other meta-type info about text strings and ranges...

             

            guy

            • 3. Re: Store data in a word or text range
              herr mueller Level 1

              I am surprised that using custom attributes for xml elements

              as a data storage would not give you what you needed.

               

              What type of data do you need to store?

              • 4. Re: Store data in a word or text range
                AdobeScripts Level 3

                herr mueller wrote:

                 

                I am surprised that using custom attributes for xml elements

                as a data storage would not give you what you needed.

                Michel didn't know about this solution.

                 

                robin

                www.adobescripts.com

                • 5. Re: Store data in a word or text range
                  scriptworker Level 1

                  Robin,

                   

                  Thanks for the hint.

                  I can achieve my goal with XML Attibutes.

                   

                  I think it's possible to write a c++ plugin

                  that add's a persistant interface to text objects.

                  This interface should have the ability to store

                  data in a word like with insertLabel on pageItems.

                   

                  It's a nice challenge when I have a lot of time :-)

                   

                  Michel