Page 1 of 1

How to replace multiple spaces with a Single space in QuarkXPress using JavaScript

Posted: 03 Aug 2018, 00:47
by Sarbjit Singh
There are times when you wish to replace all two or more spaces (or any other white character) with a single space in QuarkXPress Layout. It is very easy to achieve using RegEx / Grep in QuarkXPress 2018, which ships with a default sample JavaScript called "Grep Search and Replace".

Here are the steps:

1. Open the JavaScript palette and go to Samples -> Typography.
2. Double click "Grep Search and Replace".
3. Enter this in the RegEx input: / +/g (It means "one or more spaces in plain English)
4. Enter a space in the Replacement String input. And, voila!!

Learn more about JavaScript RegEx syntax here: