Copy link to clipboard
Copied
Hi,
I seem to be having trouble putting together the correct command in FindChangeList for an appropriate find/replace using FindChangeByList on InDesign CC 2018. I'm taking a list of price codes which I need to convert to a different set of codes given to me in a separate spreadsheet, which I've been able to convert into the following (there are actually several thousand replacements so I've just taken the top couple as an example).
text {find what:"DPGBP1323"} {change to:"DPEUR1588"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code.
text {find what:"DPGBP3598"} {change to:"DPEUR4318"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code.
text {find what:"DPGBP1295"} {change to:"DPEUR1554"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code
text {find what:"DPGBP4193"} {change to:"DPEUR5032"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code
text {find what:"DPGBP2601"} {change to:"DPEUR3121"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code
text {find what:"DPGBP1225"} {change to:"DPEUR1470"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code
text {find what:"DPGBP4274"} {change to:"DPEUR5128"} {include footnotes:true, include master pages:true, include hidden layers:false, whole word:false} Replace DPGBP code with DPEUR code
When running this through the AppleScript version of the script, I am given no message but no replacement seems to take place. The Javascript version gives me "Error Number: 25 - Error String: Expected: :" on Line 160 of the actual script file (which I have not edited).
Huge thanks to anyone who can help out!
I don't have a Mac at hand so can't test it. I remember I had a problem with the AppleScript version a few years ago: in CS? — don't remember the exact version.
I recommend you to use the JS version together with Record Find Change script written by Martin Fisher. It writes the current find/change preferences (both text and GREP) to a text file so that you can copy and /paste them into a find-change list file.
— Kas
Copy link to clipboard
Copied
Hi.
You should remove white spaces after words "include" and "whole" and and use the camelCaseSyntax which is mandatory like this:
text {find what:"DPGBP1323"} {change to:"DPEUR1588"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}
Copy link to clipboard
Copied
Thanks JR, although unfortunately there's no luck there after changing it. I remember seeing it like that on an earlier version of CC, but the samples in the current version include the spaces between the words and not in CamelCase.
Copy link to clipboard
Copied
Hi vyabsley ,
see also the following documentation compiled by Gregor Fellenz:
https://www.indesignjs.de/extendscriptAPI/indesign13/#FindChangeGrepOption.html
https://www.indesignjs.de/extendscriptAPI/indesign13/#ChangeGrepPreference.html
Regards,
Uwe
Copy link to clipboard
Copied
I don't have a Mac at hand so can't test it. I remember I had a problem with the AppleScript version a few years ago: in CS? — don't remember the exact version.
I recommend you to use the JS version together with Record Find Change script written by Martin Fisher. It writes the current find/change preferences (both text and GREP) to a text file so that you can copy and /paste them into a find-change list file.
— Kas
Copy link to clipboard
Copied
Thanks for this Kasyan, although unfortunately I'm now getting a different Javascript error:
Error Number: 17
Error String: Variable name expected
Engine: main
File: /Applications/Adobe InDesign CC 2018/Scripts/Scripts Panel/Samples/JavaScript/FindChangeByList.jsx
Line: 160
Source: app.doScript(myString, ScriptLanguage.javascript);
Copy link to clipboard
Copied
Sorry, quick update to Kasyan's reply - that script got me 99% of the way there! It added an extra couple of commas at the start which, when deleted, seemed to work. Many thanks for your answer!