This content has been marked as final. Show 13 replies
No way that I know of.
It's best to rename the new graphic to match the old one.
Double-click the old graphic in the topic and click the navigation icon at the upper right. Find the new graphic, click Open, and say OK to overwriting the old one.
It's not a lot of effort, and it has the advantage of replacing graphics in the publish directory automatically the next time you publish, rather than leaving old ones lying around.
Another way is to get a list of unused files from RH reports, go into the project folder (RH is closed) and manually delete them. This isn't much effort, but still leaves you with obsolete graphics in the publish directory.
HKabaker, in your last line you say "but still leaves you with obsolete graphics in the publish directory." I'm not sure what you mean. If I delete a file from the disk directory, are you saying that a copy of it still exists somewhere else?
I accomplished what I wanted using VBA. I made a list of all the "image..." files using a 3rd-party directory program like WinExplorer (but better). Then I got RH's report about graphic files in use. My VBA file looks in the first file for a file name and searches in the second. If it's not there, the file is deleted. The number of files went from 715 to 245. (That number doesn't count the earlier ones that I did the "right" way with named files.)
A co-worker suggested that a DOS batch script could do it, which would be more elegant, but I'm not good enough at the language. He thought it would look something like...
for /F "usebackq" %%i in (`dir /b /A:d`) do @(echo %%i & find %%i fileName & if NOT ERRORLEVEL 0 (del %%i))
If someone here is good at DOS batch scripts, this would be a better solution I think, because it would need only RH's report as input.
Well... I didn't know about it. Part of my VBA would have been unnecessary, but it was the easy part.
Anyway, in the help for the unused files report, the following sentences appear consecutively. They seem to be giving opposite messages. Can anyone clear this up?
You'll need to use the Windows Explorer to open your project folder, locate the files and delete them from your system.
Important! Avoid using Windows Explorer or your version control application to remove files.
"Important! Avoid using Windows Explorer or your version control application to remove files."
This is excellent advice.
However, you can delete a file from the project folder in Windows Explorer under these conditions:
You are certain the file is not referenced in RH at all, or
The file is listed in the RH unused files report.
AND (another guard against confusing RH)
The project is not open in RH.
The reason for the warning is the RH database will get confused if you delete or move active files between folders within the project folder, whether the project is open or not.
'Scuse me, Rick, but where do you find 'Tools > Reports > Unused Files' in your RH? It's not an option in my X5.
Forgive me if I'm missing a point somewhere.
Brian (as in bawd)
Tools | Reports | Unused Files works for me in RH HTML X5.
Going back to your earlier question:
". . . in your last line you say "but still leaves you with obsolete graphics in the publish directory." I'm not sure what you mean. If I delete a file from the disk directory, are you saying that a copy of it still exists somewhere else? "
If you are using the Publish function to deliver WebHelp files to a server, RH sends all graphics from your project folder (even the "unused" ones). The Publish function never deletes a file from the server. This is standard FTP behavior.
If your replacement image has a different name, the old one remains in your project file as an unused image, as you know.
In addition, the next time you publish WebHelp, the original image remains as an orphan in the publish directory. (It is the same, for that matter, for a topic you have deleted from the project and no longer has any references in links, TOC, Index and Search database. It does no harm, but for tidiness it needs to be deleted manually from the server.)
This is why, unless there is a reason to use a different file name for a substitute graphic, I give it the same name as the one I'm replacing. When I first insert it into the project, it replaces the originial. When I publish, it overwrites the original in the server directory.
Tools | Reports | Unused Files
A bonus denied to us dinosaurs using RH for Word, it seems.
HKabaker writes "... the next time you publish WebHelp, the original image [with a no longer used file name] remains as an orphan in the publish directory. ... When I publish [new file using old file name], it overwrites the original in the server directory."
The help system that I write is sent out with a software release. If the new system is installed in the same location as the old one, is it ever done to request that the location be purged first and install the system clean? There are quite a few sites for this system. Thanks for the explanations.
You need to find out from the people who distribute your application.
If you are giving them a complete new WebHelp package, probably they are doing a complete replacement for the client's installation.