Sort text (paragraphs) in QuarkXPress 2018

You have text in a text box in QuarkXPress that needs to be sorted?

A list that needs to be in alphabetical order?

In QuarkXPress 2018 it is easy to sort text (paragraphs), using a sample JavaScript:

Sort text in QuarkXPress using a simple JavaScript

  1. Open the JavaScript palette in QuarkXPress 2018 and navigate to “Samples > Typography”
  2. Select the text box that you need sorted
  3. Run the JavaScript “Sort Paragraphs.js”
  4. Enter whether you want the data to be sorted Ascending or Descending
  5. Enter whether you sort text or numbers


Of course this is undoable.

Remember that this is a script that you can edit and change yourself, should you want to make changes. E.g. you could make a script that doesn’t prompt you about ascending/descending or text/numbers and just runs.


  • As QXML (the text formatting accessible by JavaScript) does not support every construct in text, you will loose features which are not yet supported by QXML such as Callouts, Footnotes, Endnotes, Cross References, Anchors etc. from the selected box.
  • The Script sorts the entire content of the selected text box, not just a selection.

Quick video showing this example

More sample JavaScripts for QuarkXPress on github

Quark has created a page on github to share more sample scripts and to encourage users to share their scripts: