7 Replies Latest reply on Mar 30, 2008 6:17 PM by (Markinboone)

    what is the CS3 equivalent to the text cleanup script

      I used the javascript text cleanup in CS2 but it doesn't seem to work in ID CS3. Is there an equivalent script that will work for text cleanup in CS3?
        • 1. Re: what is the CS3 equivalent to the text cleanup script
          Level 1
          Look in the Scripts panel under Application/Samples/JavaScript for FindChangeByList.jsx

          Dave
          • 2. Re: what is the CS3 equivalent to the text cleanup script
            Level 1
            Hi Stephen,

            If you use this script, make sure that you make the change I documented in:

            http://www.adobeforums.com/cgi-bin/webx/.3bbf275d.3bc3ed3c/3

            ...or get the updated version from:

            http://www.adobe.com/products/indesign/xml_scripting.html

            (once you get there, you'll need to click the Scripting Information tab to display the scripting downloads)

            FindChangeByList.jsx is much more capable than the old TextCleanup script, and can do grep and glyph searches in addition to plain text searches.

            Thanks,

            Ole
            • 3. Re: what is the CS3 equivalent to the text cleanup script
              D Zurn Level 1
              Thanks for the updated version of the FindChangeByList.jsx script.

              I'm using it to re-map Greek Type 1 characters from a proprietary font to their correct Unicode characters in Myriad Pro. However, I had a problem with one particular glyph that I wasn't able to use (it's in the "fi" ligature spot so the glyph is tough to get to).

              Here's the rule I got to work. I had to use "glyphID" instead of the "findWhat"/"changeWhat" pair, and make sure to use the GID of the glyph instead of the Unicode value.

              I could have saved a lot of time if the sample file included a glyph line, so here's what I found to work for my fonts. (And yes, the font is named "Phili Bold Obl".)

              Imagine tabs instead of CR for readability:
              glyph
              {glyphID:200, appliedFont:"Phili Bold Obl", fontStyle:"Regular"}
              {glyphID:599, appliedFont:"Myriad Pro", fontStyle:"Bold Italic"}
              {caseSensitive:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

              Darryl Zurn
              • 4. Re: what is the CS3 equivalent to the text cleanup script
                Level 1
                This version is not as powerful as TextCleanUp script, since it is limited to the one fixed text file. TextCleanUp lets you pick the file you want to use for the replacement. I have several files for repeated tasks throughout the process of preparing a document for publication.
                With this script I have to create several files then rename the one I want to the default file name.
                • 5. Re: what is the CS3 equivalent to the text cleanup script
                  Level 1
                  Hi Markinboone,

                  Actually, FindChangeByList is much more powerful than TextCleanup (I wrote both scripts)--it has lots more features. All you need to do to get the ability to select one file or another is rename the FindChangeByList.txt file. If the script can't find a file with that name, it'll ask which file you want to use.

                  Thanks,

                  Ole
                  • 6. Re: what is the CS3 equivalent to the text cleanup script
                    Level 1
                    Thanks. Is there a place to find all the secrets of the FindChangeTExt script documented? Like how to specify formatting properties?
                    • 7. Re: what is the CS3 equivalent to the text cleanup script
                      Level 1
                      Specifically, here's something I can't figure out: how to find text, the replace with nothing (delete it).

                      I'm converting PM tags in imported Word document files. I want to set the paragraph style for the paragraph a tag is found in, then delete the tag, so that:

                      <A>Heading Level A Text

                      becomes

                      Heading Level A Text   [with paragraph style A applied]

                      With this setting the style is applied, but the tag is not stripped, rather left alone (tabs replaced with line endings here):
                      text
                      {findWhat:"<A>"}
                      {changeTo:"", appliedParagraphStyle:"A"}

                      I tried entering a second line with the third field {changeTo:""} , that is, without attributes, but I got the same result.

                      I also copied the line and modified it for other tags (to at least get the styles applied), but none of the finds work after the first one. Is there something that needs to be done to set a find to start over (top of the file)?

                      And what will happen when a find has no results? Does it ignore the change, then move to the next line? I thought that might be what's stopping the script with additional lines, but the second line should have found several instances of the find criteria.

                      Why don't I convert the PM tags to ID tags in the document first? you may ask. The problem there is I have to save the document as text only in order to import it, so I'd lose any character formatting like italics. I found out Word 2007 will search for formatted text, then insert text (such as an ID characterstyle tag) before and after it, so I can try getting characterstyle tags around formatting, but I'd rather minimize the prep work in Word.