4 Replies Latest reply on Mar 29, 2012 2:40 PM by deberm

    InDesign FindChangeList: can text be changed to para styles?

    deberm

      In InDesign CS5, can you use FindChangeList script to apply a paragraphy style to text? Or can text only be changed to text and styles only be changed to styles? For example the following script was added to the FindChangeList.txt file, but I'm receiving errors.

       

      text   {findWhat:"H2"}   {appliedParagraphStyle:"h2"}{includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Apply h2 paragraph style to text

       

      Thanks,

      deberm

        • 1. Re: InDesign FindChangeList: can text be changed to para styles?
          [Jongware] Most Valuable Participant

          You got errors? So, must we guess what ones?

           

          In the user interface, you can find text and apply a style the found text. But wait ... (trying). Yep: I never ever used this version of FindChangeList, but by looking at the examples, I found this worked just fine:

           

          text{findWhat:"H2"}{appliedParagraphStyle:"h2"}{includeHiddenLayers:true, includeMasterPages:true, includeFootnotes:true, wholeWord:false, caseSensitive:false}

           

          (The ugly table formatting comes courtesy of your friendly Jive editor; I just pasted the tab-delimited text into the forum software.)

           

          Just in case, proof it worked:

          Screen Shot 2012-03-29 at 9.58.41 PM.png

          • 2. Re: InDesign FindChangeList: can text be changed to para styles?
            deberm Level 1

            hmmm... I tried it again and got the same error:

             

            Failed with input:

            {findWhat:"H2"}

            {appliedParagraphStyle:"h2"}

             

            JavaScript Error!

            Error Number: 1

            Error String: changeText

             

            I'm using InDesign CS5, not 5.5 should that matter? There are instances of the H2 text in the doc as well as the Para Style h2.

            • 3. Re: InDesign FindChangeList: can text be changed to para styles?
              [Jongware] Most Valuable Participant

              Using CS4 over here.

               

              Strange. "changeText" indicates the script seems to think there should be something in the Change To field, but as I found there doesn't need to. Can you test if your version of the script *does* work if you put any "changeTo" text in the field as well? .. I'm not even sure what that would indicate, though, whether it works or not.

               

              I think I'm going to sit back and have CS5 users work this out.

              • 4. Re: InDesign FindChangeList: can text be changed to para styles?
                deberm Level 1

                Really appreciate your help. I did try inserting text in the "changeTo" field, but the same error pops up. The only change to InDesign's original jsx file was your tip to add the following to replace line #159.

                BTW.. Big time saver, thanks for that eariler post for some other poor soul grappling with what should be pretty straightforward!

                try {

                  app.doScript(myString, ScriptLanguage.javascript);

                } catch (e)

                {

                  alert ("Failed with input:\r"+myFindPreferences+"\r"+myChangePreferences);

                }

                 

                Not sure if this helps, but the error message does include the following referring to the FindChangeByList.jsx file.

                 

                line 165

                Source: myFoundItems = myObject.changeText();

                 

                Maybe it's just a bug in CS5 and there's no fix at this time.

                 

                Thanks again,

                deberm