2 Replies Latest reply on Mar 23, 2010 1:33 PM by Dr. TYPO

    TaggedText - how to apply while placing in text frame

    Dr. TYPO Level 1

      Hi there,

       

      I wonder how I can make use of TaggedText, which I have in a Javascript string (mixed, "normal" characters and TaggedText) to be placed in a layout text frame.

       

      Do I somehow have to switch on a TaggedText filter before placing my text and afterwards switching the filter off?

       

       

      Please help on!

       

       

      Thank you in advance,

       

      TYPO

        • 1. Re: TaggedText - how to apply while placing in text frame
          [Jongware] Most Valuable Participant

          Do you mean, your JS contains a string like

           

          var a = "<ps:hello>Hello world<ps:>";

           

          and you want ID to automatically parse the tags? That's not possible; at least, not the way you think. Parsing Tagged Text only happens on importing ("placing") from a file -- I don't think there is a way to fool ID into thinking it's reading from a file.

           

          You can, of course, simply save the string into a file and place that -- I never tried it, but I s'pose ID will have no problems with that.

          An alternative is writing your string into a text frame "as is" and use scripting to find the tags and replace them with the appropriate formatting.

          • 2. Re: TaggedText - how to apply while placing in text frame
            Dr. TYPO Level 1

            Hola Jongware!

             

            Thanx for the quick answer...

             

            I already suspected, that there's no easy way out of this, arghh!

             

            I think, I'll try it with an external lookup table (txt file), something like the following, after I have parsed the content of the story for start and end position:

             

            <tagA></tagA>             app.selection[0].parentStory.characters.itemByRange(start,end).fillColor = "Red";

            <tagB></tagB>               app.selection[0].parentStory.characters.itemByRange(start,end).fillColor  = "Green";

            ...

             

            Unfortunately this will slow down the whole process, switching the TaggedText filter on and off would have been much more effective... the heck with it.

             

             


            Thank you anyway,

             

            TYPO

            ***