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

FindChangeByList - need help with my FindChangeList.txt file

Community Beginner ,
Jan 03, 2018 Jan 03, 2018

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!

TOPICS
Scripting

Views

2.2K

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

Guru , Jan 03, 2018 Jan 03, 2018

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

Votes

Translate

Translate
Community Expert ,
Jan 03, 2018 Jan 03, 2018

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}

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 Beginner ,
Jan 04, 2018 Jan 04, 2018

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.

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 ,
Jan 03, 2018 Jan 03, 2018

Copy link to clipboard

Copied

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
Guru ,
Jan 03, 2018 Jan 03, 2018

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

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 Beginner ,
Jan 04, 2018 Jan 04, 2018

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);

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 Beginner ,
Jan 04, 2018 Jan 04, 2018

Copy link to clipboard

Copied

LATEST

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!

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