• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

208

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

Community Expert , 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

Votes

Translate

Translate
Community Expert ,
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

Votes

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
Community Expert ,
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

Votes

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
Community Expert ,
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

Votes

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
Community Expert ,
Feb 26, 2022 Feb 26, 2022

Copy link to clipboard

Copied

Fantastic resource and Info panel tip! Thanks!

Votes

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 !

 

Votes

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
Community Expert ,
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)

Votes

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