GREP find results change sort order

Home Forums InDesign Add-ons (Scripts, Scripting, and Plug-ins) GREP find results change sort order

Tagged: ,

This topic contains 2 replies, has 2 voices, and was last updated by  Ward Baxter 6 days ago.

  • Author
    Posts
  • #103074

    Ward Baxter
    Member

    As a test, I’m running a very basic Applescript to iterate through consecutive song numbers in a document. The song numbers are all in order in the document, but the GREP results are not in order. i.e. the numbers returned are 5,6,22,24,3,1,12,etc. instead of 1,2,3,4,5,etc. This is not a flowing document, so I presume it may be based on the order the text frames were created? I can sort the array(s) after the fact, but this seems like there’s a grep preference that I’m unaware of, or something? Any insights?

  • #103081

    Ward, you are correct. The find-order is sometimes or mostly (not everytime) the order of creation. There is no sort function for that in the UI. You are good to go, if you collect everything in an array and sort it.

    Kai

  • #103094

    Ward Baxter
    Member

    Thanks, Kai! I’ll build a handler to sort as part of the process from now on. Best, ~W

You must be logged in to reply to this topic.