6 Replies Latest reply: Apr 13, 2012 6:47 PM by HarveyLiu RSS

    Indesign CS3 Find and Change Error

    HarveyLiu Community Member

      I aim to find some words in a same file then that apply to an indicated character style, but it doesn't work.

       

      According the Adobe's notes. :

      //More complex example:

      //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".

       

      I should be able to get what I want. But it gives me an error like this:

       

      but I get this error:

      Error Number: 25

      Error String: Expected: :

       

      Line 159

       

      Can someone tells me how can fix it.

       

      thanks and please!!!

        • 1. Re: Indesign CS3 Find and Change Error
          [Jongware] MVP

          It seems like you are mixing Javascript notation (camelCase, such as in "appliedCharacterStyle") and AppleScript notation (separate words, such as "include hidden layers"). Perhaps that's where your poor computer got confused. Use the correct notation for the script language you are using.

          • 2. Re: Indesign CS3 Find and Change Error
            [Jongware] MVP

            Wait, that example is from Adobe! That makes it A Bad Example.

             

            Nevertheless, this ought to work if you use the correct notation for the script language you are using.

            • 3. Re: Indesign CS3 Find and Change Error
              HarveyLiu Community Member

              I do it as your says to separate the script notation, but I got a same error message:

               

              but I get this error:

              Error Number: 25

              Error String: Expected: :

               

              Line 159

               

              then I look into the VB script line 159 the script is: "    myInDesign.DoScript myScript, idScriptLanguage.idJavascript". What is wrong with that script?

               

              then I try the JV script, I got another error message: footnotes not correct. What is wrong with that foot notes?

              • 4. Re: Indesign CS3 Find and Change Error
                Mary Posner Community Member

                I think Jongware's right, this example has AppleScript mixed with Javascript, so it won't run completely in either one. AppleScript can't get past the "findWhat", so it bombs out on you there. If you try to run it through Javascript, it's bombing out at footnote part, which is written in AppleScript format.

                 

                Try this, through Javascript:

                 

                //text {findWhat:"^9^9.^9^9"} {appliedCharacterStyle:"price"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find $10.00 to $99.99 and apply the character style "price".

                 

                or this in AppleScript:

                 

                //text {find what:"^9^9.^9^9"} {applied character style:"price"} {include footnotes:true, include master pages:true, include hidden layers:true, whole word:false} Find $10.00 to $99.99 and apply the character style "price".

                • 5. Re: Indesign CS3 Find and Change Error
                  HarveyLiu Community Member

                  All about your says are very right, it runs like a dream, thank you so much.

                  • 6. Re: Indesign CS3 Find and Change Error
                    HarveyLiu Community Member

                    Thanks for all you guys' patients, who tells me how to fix the find and change error.

                     

                    thank you so much.

                     

                    but one thing more I want to ask is how to change back to No style?

                     

                    How can tell the script what I want to?