4 Replies Latest reply on Feb 5, 2013 5:21 AM by 4everJang

    Script needed asap to rename linked graphic folder path name in FM11

    jamesm0671

      Hello,

       

      I am using FrameMaker 11 in the Technical Communication Suite 4 and I am looking for a script that can "hopefully" take care

      of these two issues.

       

      Here they are:

       

      1. I need to rename the linked FrameMaker 11 graphic paths in a folder full of FrameMaker files.  For example, I need to change:   \FrameMaker Book\Graphics\ 
        to:  \FrameMaker_Book_A\Graphics_Catalog\
      2. I have already renamed all the graphics using the script below, but now need a script that will update to the new graphic file path and new graphic file name, using a two column table.

       

      So, to make it simple, the FrameMaker script would open the two columns (for example in a FrameMaker table in a stand-alone file), and then search out (like a Windows Grep) for the old file path and old graphic file path, find the old path and then come back to that FrameMaker table and insert the new file path and graphic name from the second column in that FrameMaker table.

       

      Next, the script would go down to the next FrameMaker entry down in the first column and repeat the process until it is done.

       

      http://windowssecrets.com/forums/showthread.php/108928-Two-part-Macro-needed-for-batch-fil e-renaming-(Excel-2003-SP3)

       

       

      Sub RenameFiles()

      ' Modify as needed but keep trailing backslash

      Const strPath = "C:\Temp1\"

      Dim r As Long

      Dim n As Long

      n = Cells(Rows.Count, 4).End(xlUp).Row

      For r = 5 To n

      Name strPath & Cells(r, 4) As strPath & Cells(r, 5)

      Next r

      End Sub

       

       

      The code above does a fanstastic job (in Excel) at renaming thousands of graphics, but I now need a script (preferably in FM without having to save out to MIF) that will find the old graphic and old graphic path in a folder full of documents and then reference a FrameMaker file (or Excel file if needed) and do the line for line swap all the way down the column rows.

       

      If nothing comes up, I will have to do it by hand (grunt work) and I really do not have the luxury of time, at the moment.  Besides, why do something by hand when an automated script can do it for you...

       

      Thanks in advance for any ideas.

       

      Regards,

       

      JIm



        • 1. Re: Script needed asap to rename linked graphic folder path name in FM11
          frameexpert Level 4

          Hi Jim,

           

          Take a look at this blog post:

           

          http://frameautomation.com/2010/02/23/managing-imported-images-solution/

           

          One caveat: These scripts are done in FrameScript instead of ExtendScript. If you don't have FrameScript, it costs $149 (see http://www.framescript.com). Please let me know if you are interested in the scripts. Thanks.

           

          Rick Quatro

          • 2. Re: Script needed asap to rename linked graphic folder path name in FM11
            jamesm0671 Level 1

            Hi Rick,

             

            This sounds like exactly what I need.

             

            I purchased FrameScript Friday night but the license is not working.  At the moment, I am waiting to hear back on Marjorie at FrameScript (hopefully today) and then I will pickup the script you are talking about.

             

            I assume that the script works in the regular FrameMaker 11 files and there is no need to convert over to MIF for it to work.  Is that correct?

             

            I already have a spreadsheet (Microsoft Excel 2010)

             

            Thanks again for the quick response. 

             

            As soon as I hear from Marjorie, you will be hearing from me.

             

            Thank you very much.

             

            Regards,

             

            Jim

            • 3. Re: Script needed asap to rename linked graphic folder path name in FM11
              Russ Ward Level 4

              Hi Jim,

               

              This probably won't be immediately helpful, but I wanted to point out that ExtendScript is fully capable of this, but your "asap" requirement is a problem unless you are willing to pay somebody else. Graphic path management is not terribly difficult at a basic level, but reading and/or writing to FM tables is tricky. Reading and writing to an Excel spreadsheet is even more tricky. To do this yourself, you'll need significant expertise with ES. It sounds like buying the script from Rick might be your only quick option, and as I know Rick, I suspect you'll receive a quality product.

               

              Russ

              • 4. Re: Script needed asap to rename linked graphic folder path name in FM11
                4everJang Level 3

                Jim,

                 

                I wholeheartedly agree with Russ' suggestion to hire Rick Quattro for this job. However, instead of reading and writing an Excel document from ExtendScript directly, I would suggest using a CSV file instead. In my script I use CSV files extensively, after having first tried to read/write Excel direct. The difference is a runtime of seconds versus hours, and you can guess which script version was fastest. It should not be a problem to read/write CSV from Excel, as this is a one-time operation per book (I guess), whereas the read/write operations executed by the script would be many per file.

                 

                I do not have any time available right now, otherwise I could offer you a script. But I am sure Rick can do a fast job and he will probably charge you less (I guess life is less expensive in his neck of the woods or he is just a much nicer guy). I have had Rick create scripts for me in the past and I was more than satisfied with his work.

                 

                Ciao and good luck

                 

                Jang