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

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

New Here ,
Feb 04, 2013 Feb 04, 2013

Copy link to clipboard

Copied

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-file-renaming...

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



TOPICS
Scripting

Views

1.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
Community Expert ,
Feb 04, 2013 Feb 04, 2013

Copy link to clipboard

Copied

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

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
New Here ,
Feb 04, 2013 Feb 04, 2013

Copy link to clipboard

Copied

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

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
Mentor ,
Feb 05, 2013 Feb 05, 2013

Copy link to clipboard

Copied

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

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
Advocate ,
Feb 05, 2013 Feb 05, 2013

Copy link to clipboard

Copied

LATEST

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

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