0

Every month I have to order a long list of names alphabetically by last name.
Is there a way to do this all in one single script?

This is what I am currently doing: Use a GREP to place the last names before the first names, sort the list using the SortParagraphs VBScript, then use another GREP to place the last names after the first names.

Step 1: Use a GREP to place the last names before the first names using these settings.
Find what: ^(.+?) (.+)
Change to: $2@$1

Step 2: Sort the list using: Scripts>Application>Samples>VBScript>SortParagraphs
(note - i am using the VBScript because the JS script makes my file crash every time)

Step 3: Use another GREP to place the last names after the first names using these settings.
Find what: ^(.+)@(.+)
Change to: $2 $1

2
  • 1
    have you tried indesign's data merge features? You can presort a csv/data file prior to bringing it in. Or simply export the names to a text file and paste it.
    – Yorik
    Commented Nov 29, 2023 at 15:47
  • 2
    Why not do the ordering in Excel, before importing the data into INDD ?
    – Lucian
    Commented Nov 29, 2023 at 15:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.