White space(s) code in FindChangeByList script.

New Here ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

Hello all. 

After more than a decade of using InDesign I found out about the Find change by list script. 🙂

New as I am to this, and with no experiece of encodig etc, I could not find out the codes for "Insert white space" (for example: Hair space)

Where can I find the right codes for white space, characters etc? 

 

Thankful for any help with this. 

/ J

TOPICS
How to , Scripting , Type

Views

128

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Community Professional , Feb 26, 2022 Feb 26, 2022
For InDesign specific special character list and their unicode values, see the following link https://www.indiscripts.com/blog/public/data/idcs4-special-characters/en_InDesignCS4-CS5-SpecialChars.pdf Another useful trick is to open the Info Panel, then select the character you need to know the unicode of. The unicode is displayed on the panel. -Manan

Likes

Translate

Translate
Adobe Community Professional ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

Hi @Johan23342354hbx9, I don't know that script, but if it is using ExtendScript literal strings or RegExp to do the find/change, you can insert unicode directly by prefixing the unicode with \u. You can find the unicodes for various characters by searching internet, eg. here are unicode spaces. So a hair space would look like this:

var myString = 'The quick brown\u200Afox jumps.';
var myRegExp = /over the\u200Alazy dog/i;

However if the script is using Indesign's findGrep function it is slightly different. You must give it a string that Indesign will interpret as a regular expression. eg. "The quick brown\\x{200A}fox." The double backslash is to escape the single backslash.

- Mark

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

An example findchange string using the list given by @m1b 

grep {findWhat:"\\x{2003}"} {changeTo:"\\x{200A}"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
For text search the syntax to use the unicode is to enclose the unicode value between <>
So an example of it would be <2003>

-Manan

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

For InDesign specific special character list and their unicode values, see the following link

https://www.indiscripts.com/blog/public/data/idcs4-special-characters/en_InDesignCS4-CS5-SpecialChar...

Another useful trick is to open the Info Panel, then select the character you need to know the unicode of. The unicode is displayed on the panel.

-Manan

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

Fantastic resource and Info panel tip! Thanks!

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

LATEST

Great resource! Thanks !

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

In addition to the other resources listed, in your Find Change panel, under Find What, there's a little arrow. There are a number of dropdowns options there including all the different white space options. You can select those and have the panel populate with the codes. Just be sure to escape backslashes with another backslash in the script code. (ie \\t for tab stop)

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines