4 Replies Latest reply on Feb 8, 2010 5:59 AM by Ola K

    how to find a paragraph with restarting numbering [CS3] [Javascript]

    Ola K Level 1

      Hi,

       

      Does any of you know how to solve this one:

       

      I am making a script which needs to search for numbered paragraphs, and assign it with a specific paragraph style. It should go like this:

      If the paragraph's numbering restarts (meaning it starts with 1) - the style should be "Number1".

      If the paragraph's numbering continues from where it is - the style should be "Number".

       

      It sounds quite simple in theory, and even doable with the simple "Find/Change" operation in InDesign, but when I went over the object model, I couldn't find a single method for my script to differentiate between the two cases. Does any of you know of a method for this?

       

      Here is what I've got so far:

       

       

      app.findTextPreferences = NothingEnum.nothing;
      app.changeTextPreferences = NothingEnum.nothing;

      app.findTextPreferences.bulletsAndNumberingListType = 1280601709; // Numbers
       
      app.changeTextPreferences.appliedParagraphStyle = "Number";

      app.changeText ();

      app.findTextPreferences = NothingEnum.nothing;
      app.changeTextPreferences = NothingEnum.nothing;

       

       

      Thanks,

      Ola