Highlighted

FindChangeByList.jsx - text updating to characters instead of whole word

Community Beginner ,
Apr 24, 2020

Copy link to clipboard

Copied

I am on Windows using InDesign with the latest version of CC.

 

When I run FindChangeByList.jsx , it is grabbing the bold part number and updating everything with it before moving to the next find change which includes it. It's not recognizing the "wholeWord" scenario. (also, I used BOLD to illustrate a point, I am using Excel and note pad to do these. There is nothing bolded in my process.)

 

Expecting

WH5P = 16801888

WH5PB = 16801680

WH5PBR = 16801854

 

Actual Results

WH5P = 16801888

WH5PB = 16801888B

WH5PBR = 16801888BR

 

text {findWhat:"WH5P"} {changeTo:"16801888"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.
text {findWhat:"WH5PB"} {changeTo:"16801680"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.
text {findWhat:"WH5PBR"} {changeTo:"16801854"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Hi Eric,

The string you have used is wrong, in order to set the whole words you need to use wholeWord and not includeWholeWord. Also this option needs to be set to true for your use case if i understood it correctly. Try the following strings

 

text	{findWhat:"WH5P"}	{changeTo:"16801888"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PB"}	{changeTo:"16801680"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PBR"}	{changeTo:"16801854"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}

 

 

Make sure you have tab as the seperator character when you copy these strings to your text file.

 

-Manan

 

Topics

Bug, Import and export, Print, Scripting, Type

Views

245

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

FindChangeByList.jsx - text updating to characters instead of whole word

Community Beginner ,
Apr 24, 2020

Copy link to clipboard

Copied

I am on Windows using InDesign with the latest version of CC.

 

When I run FindChangeByList.jsx , it is grabbing the bold part number and updating everything with it before moving to the next find change which includes it. It's not recognizing the "wholeWord" scenario. (also, I used BOLD to illustrate a point, I am using Excel and note pad to do these. There is nothing bolded in my process.)

 

Expecting

WH5P = 16801888

WH5PB = 16801680

WH5PBR = 16801854

 

Actual Results

WH5P = 16801888

WH5PB = 16801888B

WH5PBR = 16801888BR

 

text {findWhat:"WH5P"} {changeTo:"16801888"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.
text {findWhat:"WH5PB"} {changeTo:"16801680"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.
text {findWhat:"WH5PBR"} {changeTo:"16801854"} {includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,includeWholeWord:false} Find all old prices and replace with new prices.

Adobe Community Professional
Correct answer by Manan Joshi | Adobe Community Professional

Hi Eric,

The string you have used is wrong, in order to set the whole words you need to use wholeWord and not includeWholeWord. Also this option needs to be set to true for your use case if i understood it correctly. Try the following strings

 

text	{findWhat:"WH5P"}	{changeTo:"16801888"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PB"}	{changeTo:"16801680"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PBR"}	{changeTo:"16801854"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}

 

 

Make sure you have tab as the seperator character when you copy these strings to your text file.

 

-Manan

 

Topics

Bug, Import and export, Print, Scripting, Type

Views

246

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
Adobe Community Professional ,
Apr 25, 2020

Copy link to clipboard

Copied

Hi Eric,

The string you have used is wrong, in order to set the whole words you need to use wholeWord and not includeWholeWord. Also this option needs to be set to true for your use case if i understood it correctly. Try the following strings

 

text	{findWhat:"WH5P"}	{changeTo:"16801888"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PB"}	{changeTo:"16801680"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}
text	{findWhat:"WH5PBR"}	{changeTo:"16801854"}	{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true,wholeWord:true}

 

 

Make sure you have tab as the seperator character when you copy these strings to your text file.

 

-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
Reply
Loading...
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Thanks! I tried that and it didn't work.

When I copy paste the line here from the .txt doc, it loses the tabs. They are there though. I pasted it into InDesign with hidden characters "on" to show the them. They screenshot is at the bottom of this reply. Just to be clear, I format my all data in Excel and save as a tab-delimited .txt file.

 

This is the new line structure I used with the wholeWord update.

 

textTAB{findWhat:"AWS123"}TAB{changeTo:"1234567890"}TAB{includeFootnotes:true,includeMasterPages:true,includeHiddenLayers:true, wholeWord:false}TABFind all current and replace with custom part numbers.

 

Screen shot below showing tab characters:Capture.JPG

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
Reply
Loading...
Adobe Community Professional ,
Apr 27, 2020

Copy link to clipboard

Copied

I also see that i mentioned to set wholeWord to true but you still have it set to false. Can you try with setting it true

 

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
Reply
Loading...
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

It just worked!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Sorry, I got so obsessed with making sure the tabs worked I ignored the True statement!

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
Reply
Loading...
Adobe Community Professional ,
Apr 27, 2020

Copy link to clipboard

Copied

Send me a sample InDesign document to test

 

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
Reply
Loading...
eric78 LATEST
Community Beginner ,
Apr 27, 2020

Copy link to clipboard

Copied

Do you when it should be set to False?

 

I copied and pasted this from the orignal Adobe text file that is there by default with all the examples:

 

text {findWhat:" - "} {changeTo:"^="} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all space-dash-space and replace with an en dash.
text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all dash-dash and replace with an em dash.

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
Reply
Loading...