GREP find results change sort order
- This topic has 2 replies, 2 voices, and was last updated 6 years ago by .
- You must be logged in to reply to this topic.
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / GREP find results change sort order
Learn / Forums / InDesign Add-ons (Scripts, Scripting, and Plug-ins) / GREP find results change sort order
Tagged: applescript, GREP
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?
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
Thanks, Kai! I’ll build a handler to sort as part of the process from now on. Best, ~W
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies allows us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
To provide the best experiences, we and our partners use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us and our partners to process personal data such as browsing behavior or unique IDs on this site and show (non-) personalized ads. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Click below to consent to the above or make granular choices. Your choices will be applied to this site only. You can change your settings at any time, including withdrawing your consent, by using the toggles on the Cookie Policy, or by clicking on the manage consent button at the bottom of the screen.
You have to be logged in to save.
Not a member? Join Today - it's FREE!