5 Replies Latest reply on Dec 22, 2008 1:13 PM by (mattnewell)

    Change text problem CS3

      I am having problems with i2of5 barcode where some of the encoded values for the barcode are the same as InDesign values.

      e.g. find text "barcode" change text "ËU(K\tÌ"

      inDesign recognizes the \t for a tab. Is it possible to turn off these keywords or variables so InDesign will not replace the string with a tab or whatever the variable stands for?
        • 1. Re: Change text problem CS3
          Level 1
          Try escaping the \

          find text "barcode" change text "ËU(K\\tÌ"

          Bob
          • 2. Re: Change text problem CS3
            Level 1
            "\\t" instead of "\t" should work

            you need to double every "\"

            robin

            --
            www.adobescripts.com
            • 3. Re: Change text problem CS3
              Level 1
              Unfortunately if you escape the \t or \r you get a single \ with a tab after. Also this is not the only case you also have ^p ^n and the list goes on and on.

              I would prefer turning this feature off and back on due to the fact I do use a lot of these features such as ^p and ^n for carriage returns.
              • 4. Re: Change text problem CS3
                [Jongware] Most Valuable Participant
                Not true.

                You are working in a script language. That translates "\t" to a tab while the script is being parsed, and (apparently) the tab survives the translation into the 'real' application call to search.

                Next level is escaping the tab: "\\t". Now the codes get translated (by the parser) into "\t", which is, ta-da, a tab
                i for the application search string.

                So, you have to escape the escaped escape (?), leading to the somewhat bewildering "\\\\t". Double backslashes are translated into single ones ("\\t") which is passed over to the search inside InDesign, which translates it into "\t", which is what you asked.

                The "^" is slightly easier, as it (probably!) is not 'pre-parsed' by your script, just by the InDesign Search engine. As in InDesign itself, to search for a single "^", enter two.

                By the way ... there is no single search string in which both "\t"
                i and
                "^p" are translated into a tab and paragraph return. The former is a GREP search expression, the latter a native InDesign Text search one.
                • 5. Re: Change text problem CS3
                  Level 1
                  Just to give some background I am using AppleScript and UT-8 XML so I can get the string to InDesign with out issues.

                  So to test I was using the InDesign interface and doing a manual find and change. If you use a grep express and put \\t you will get a \ with a tab after. I will say it was confusing the way I explained the issue because I had two different things going on at once.

                  The first problem I ran into was with ^p using change text so to fix this I went to change grep. By doing this I fixed one problem and created another. I see now I can use change text and double up on the ^ and the problem should be resolved.

                  thanks for the help