8 Replies Latest reply on Jul 27, 2011 4:25 PM by JR309

    Need to change hundreds of old catalog numbers to new...

    JR309 Level 1

      I'm no idiot, but I can't figure this out. I can code an entire website in a text editor, but this is baffling me.

      I've been searching the web and trying to figure out FindChangeByList.jsx for a few hours, and I'm getting nowhere. None of the information I'm finding about using scrips in InDesign is helpful, or straight forward, or complete. And, whatever I'm doing, I'm doing wrong, because FCBL is non-responsive.

       

      I'm using InDesign CS5 in Snow Leopard on an Intel Macbook Pro.

       

      Here's what I need to do:

      I have a catalog full of old catalog codes in the format: SJV 00000-00 that I need to change to correspoding codes in the format: ISBN 978-0000-00000

       

      I have an Excel file with the old codes in Column A and the new codes in Column B.

       

      I've exported the 2 columns to a tab-delimited text file.

      I have the catalog full of old numbers open.

      I've tried selecting the exported text file when the script calls for it, but nothing happens.

       

      What am I missing???

        • 1. Re: Need to change hundreds of old catalog numbers to new...
          John Hawkinson Level 5
          I've exported the 2 columns to a tab-delimited text file.

          I've tried selecting the exported text file when the script calls for it, but nothing happens.

           

          What am I missing???

          FindChangeBylist.jsx does not take tab-delimited text file with 2 columns!

          Look at FindChangeSupport/FindChangeList.txt. Read the top comments of FindChangeByList.jsx.

          It reads a very particular format.

          You can make your spreadsheet export it.

           

          There's probably an easier way, but offhand I'm not sure what the best one to recommend it.

          • 2. Re: Need to change hundreds of old catalog numbers to new...
            JR309 Level 1

            John Hawkinson wrote:

             

            I've exported the 2 columns to a tab-delimited text file.

            I've tried selecting the exported text file when the script calls for it, but nothing happens.

             

            What am I missing???

            FindChangeBylist.jsx does not take tab-delimited text file with 2 columns!

            Look at FindChangeSupport/FindChangeList.txt. Read the top comments of FindChangeByList.jsx.

            It reads a very particular format.

            You can make your spreadsheet export it.

             

            There's probably an easier way, but offhand I'm not sure what the best one to recommend it.

             

            Thanks, John.

            The text file I'm using is NOT 2 columns. [the spreadsheet with the raw data is)

             

            From the file: FindChangeList.txt

             

            //This data file is tab-delimited, with carriage returns separating records.

            //The format of each record in the file is:
            //findType<tab>findProperties<tab>changeProperties<tab>findChangeOptions<tab>description

            //Very simple example:
            //text {findWhat:"--"} {changeTo:"^_"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false} Find all double dashes and replace with an em dash.

             

            O.K., so thinking that I understood this, I created a text file from the spreadsheet data with this format:

             

            text {findWhat:"SJV-00000-00000"} {changeTo:"ISBN-000-00000-00000"} {includeFootnotes:true, includeMasterPages:true,...etc.}

            text {findWhat:"SJV-00000-00001"} {changeTo:"ISBN-000-00000-00001"} {includeFootnotes:true, includeMasterPages:true,...etc.}

            text {findWhat:"SJV-00000-00002"} {changeTo:"ISBN-000-00000-00002"} {includeFootnotes:true, includeMasterPages:true,...etc.}

            text {findWhat:"SJV-00000-00003"} {changeTo:"ISBN-000-00000-00003"} {includeFootnotes:true, includeMasterPages:true,...etc.}

            text {findWhat:"SJV-00000-00004"} {changeTo:"ISBN-000-00000-00004"} {includeFootnotes:true, includeMasterPages:true,...etc.}

             

            and so on...

             

            I created the above text file, and with the InDesign catalog document open, tried running the script.

            Nothing happens. It doesn't ask for the text file, and so, the data in the catalog doesn't change.

             

            -- Does the text file need to have some kind of headers or other java code to work?

            -- Do I need to place the text file somewhere specific? In the Find/Change support folder?

            -- Do I need to enter something into the Find/Change dialog in order for the script to work?

            -- Do I need to copy the [properties records] into the FindChangeList.txt file?

                 I tried that ... it didn't work.

            -- Do I need to edit the script to tell it which text file to look for, if mine isn't named FindChangeList.txt ?

                I tried that too ... it didn't work.

            -- Do I need to edit the FindChangeList.txt file somehow, instead of creating my own with a different name?

             

            The problem is, there's no full explanation anywhere [that I can find] about HOW to use the script, or how the script and the text file work together.

            Step-by-step would be great, because for people unfamiliar with scripting, language and methods that make perfect sense to script-users is confusing to non script-users.

             

            S-B-S Example:

            A. Create a text file with this format...

            B. Place the text file [here]

            C. Change [this line] in the script to [this]...

            D. Open your InDesign Document

            E. Make sure you have the TEXT tool selected...

            ....etc.

             

            If someone could just outline this and then post it somewhere conspicuous..................................

             

            jr

             

             

             

            • 3. Re: Need to change hundreds of old catalog numbers to new...
              John Hawkinson Level 5

              -- Do I need to edit the script to tell it which text file to look for, if mine isn't named FindChangeList.txt ?

               

              *     I tried that too ... it didn't work.*

               

              Sort-of. It looks for the .txt file in a specific place. If it can't

              find it there, it pops up a dialog to navigate to it. I would suggest

              editing the script and changing it to look for a file that does

              not exist, like "xFindChangeList.txt", and then letting it pop up the

              dialog and then you can navigate to your own file.

              • 4. Re: Need to change hundreds of old catalog numbers to new...
                JR309 Level 1

                John Hawkinson wrote:

                 

                -- Do I need to edit the script to tell it which text file to look for, if mine isn't named FindChangeList.txt ?

                 

                *     I tried that too ... it didn't work.*

                 

                Sort-of. It looks for the .txt file in a specific place. If it can't

                find it there, it pops up a dialog to navigate to it. I would suggest

                editing the script and changing it to look for a file that does

                not exist, like "xFindChangeList.txt", and then letting it pop up the

                dialog and then you can navigate to your own file.

                 

                 

                I tried that (and a LOT of other stuff) before I started posting here to find help.

                I created the text file, hid the original "FindChangeList.txt" file and ran the script.

                 

                I used a text file with this format:

                 

                text {findWhat:"SJV 33235"} {changeTo:"978-14207-24097"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

                 

                Nothing happened. No changes to the InDesign document and no message from the script.

                 

                Tried a text file with this format:

                 

                     SJV 33235 <tab> 978-14207-24097

                 

                ...thinking that _maybe_ the script only wants the tabbed data and inserts it into its own {findWhat:""}  {changeTo:""} list

                 

                Of course, again, nothing happened.

                 

                I clearly do not understand what's going on, OR the script is incompatible with ID CS5 . . . or something . . .

                 

                Is a text file with this format correct?:

                 

                text {findWhat:"SJV 33235"} {changeTo:"978-14207-24097"} {includeFootnotes:true, includeMasterPages:true, includeHiddenLayers:true, wholeWord:false}

                 

                If so, and the script asks for a text file, and I select my text file, the script should work, right??

                Why isn't it working?

                 

                :-(

                • 5. Re: Need to change hundreds of old catalog numbers to new...
                  Fred Goldman Level 3

                  Do you have tabs in between as below?

                   

                  text<tab>{findWhat:"SJV 33235"}<tab>{changeTo:"978-14207-24097"}<tab>{includeFootnotes:true, includeMasterPages:true,  includeHiddenLayers:true, wholeWord:false}<paragraph mark>

                  1 person found this helpful
                  • 6. Re: Need to change hundreds of old catalog numbers to new...
                    Fred Goldman Level 3

                    Are you getting a dialog asking for the search range like that looks like this?

                     

                    Capture.GIF

                     

                    If not then try running this one line script and then try running again the FCBL script.

                     

                    app.scriptPreferences.userInteractionLevel = UserInteractionLevels.INTERACT_WITH_ALL;

                    • 7. Re: Need to change hundreds of old catalog numbers to new...
                      Mary Posner Level 3

                      Also, do you have a tab at the end? It's been awhile since I used this, but I seem to remember that I had problems if I didn't have a comment at the end as shown in the example text, or at least a tab at the end of the line. Worth a try, anyway.

                      1 person found this helpful
                      • 8. Re: Need to change hundreds of old catalog numbers to new...
                        JR309 Level 1

                        Fred Goldman wrote:

                         

                        Do you have tabs in between as below?

                         

                        text<tab>{findWhat:"SJV 33235"}<tab>{changeTo:"978-14207-24097"}<tab>{includeFootnotes:true, includeMasterPages:true,  includeHiddenLayers:true, wholeWord:false}<paragraph mark>

                        Eureka!!!

                        Thanks Fred!

                         

                        My text file didn't have tabs between "text" and the first "{"  . . . they were spaces.

                         

                        I inserted tabs (with find/replace) and the text file now works!!

                        [If the script had returned an error of any sort, I may have discovered this myself.]

                         

                        I really appreciate the clarification!

                         

                        JR