4 Replies Latest reply on Jul 21, 2009 1:04 AM by Huksy

    [JS CS3] Crash by using FindChange-Script

    Huksy

      This is a very unusual and mysterious problem:

      I've a document within 10 stories (my chapters) und I want to replace all quotation marks by using the FindChange-Script ...

       

      text    {findWhat:"^{"}    {changeTo:"<00BB>"}

       

      When I execute the script about each separate story the script works fine. But when I execute the script about the whole document a progress bar with the text "Replacing text" is started. And by reaching the end InDesign crashes with the information "unknown software exception (0xc000000d)".

      I already tried the same script on a different computer and by copying all stories in one. Nothing works!?

       

      So it seems that the script crashes because of the size of the document!?

      Did anyone know this kind of problem? ... I don't get it!???

      H.

       

      PS: Replacing all quotation marks by the InDesign-Search+Replace works fine too.

        • 1. Re: [JS CS3] Crash by using FindChange-Script
          Kasyan Servetsky Level 5

          Version of the script for CS4 works well on CS3 — I tested the line you had posted on CS3 for Mac.

           

          Kasyan

          • 2. Re: [JS CS3] Crash by using FindChange-Script
            Huksy Level 1

            It works fine by me as well. But when I got a "critical" size of text (e.g. 230 pages of my book) the script crashes InDesign.

             

            :/

            H.

            • 3. Re: [JS CS3] Crash by using FindChange-Script
              Olav Martin Kvern Level 3

              Hi Huksy,

               

              If the script works with smaller documents, then the problem is probably not with the script. It's more likely one of the following:

               

              a. Your hard drive is running out of space or is badly fragmented, or

               

              b. You have some other problem, such as a corrupt font or a permissions problem, or

               

              c. The large number of undo actions is causing the script to run so slowly that the application appears to have crashed

               

              If you think it might be the last item, then we can try running the script using the doScript method.

               

              Thanks,

               

              Ole

              1 person found this helpful
              • 4. Re: [JS CS3] Crash by using FindChange-Script
                Huksy Level 1

                Hi Olav,

                 

                a) My hard drive has 13 GB free space and was defragmented a week ago. In addition: I tested the script on an other computer with the same result.

                b) All fonts are embedded and I am the "administrator"

                c) The script is executed by the "doScript" method:

                function myFindText(myObject, myFindPreferences, myChangePreferences, myFindChangeOptions){
                    //Reset the find/change preferences before each search.
                    app.changeTextPreferences = NothingEnum.nothing;
                    app.findTextPreferences = NothingEnum.nothing;
                    var myString = "app.findTextPreferences.properties = " + myFindPreferences + ";";
                    myString += "app.changeTextPreferences.properties = " + myChangePreferences + ";";
                    myString += "app.findChangeTextOptions.properties = " + myFindChangeOptions + ";";
                    app.doScript(myString, ScriptLanguage.javascript);
                        myFoundItems = myObject.changeText();
                    //Reset the find/change preferences after each search.
                    app.changeTextPreferences = NothingEnum.nothing;
                    app.findTextPreferences = NothingEnum.nothing;
                }
                

                 

                The curious thing about is: When I search for other items e.g. n-dashs the script works fine. It crashes just by searching quotation marks.

                But even though: Thanks for the your answers!

                 

                H.