Page 1 of 1
Rename Selected Media Files
Posted: 28 Nov 2017 14:55
by David Potter
Dear Jane/Forum
Looking at your Plugin (Rename Selected Media Files) would it be possible to change the plugin to work from the Source Record Title instead of the Media Record? I have a large number of Baptism records whereby the Source record would read something like: Baptism Bishops Cleeve, Gloucestershire, England (The Parish Church) date and name. These have been created by AS.
I have since discovered the Parish Church name is St Michaels and All Angels, so I would like to change The Source record to read: Baptism Bishops Cleeve, Gloucestershire, England (St Michaels & All Angels) date and name, and then update the Media Record and Media Files accordingly. I can change the Source Records manually but would like the related Media Record and Media File(s) to follow suit and be renamed as per the Source Record Title.
Is this possible or am I forced to make the changes entirely manually?
Many thanks.
David
Re: Rename Selected Media Files
Posted: 28 Nov 2017 15:11
by tatewise
Assuming that Baptism Bishops Cleeve, Gloucestershire, England (The Parish Church) is unique and already appears in the Source record title, Media record title and File Link name, then the Edit > Find and Replace command should change all those, or if not then the Search and Replace Plugin should.
That just leaves the Media folder filenames themselves, and I am sure there are File Explorer tools that would do that in bulk, and suspect other users will suggest some.
Do take a Project Full Backup before you start experimenting.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 15:21
by David Potter
Thank you Mike
Yes - I did wonder if the Search and Replace might handle it but then as you say the Media files themselves would need attention. I guess your suggestion would handle the bulk of the task if I were to verify each update. I'll take a full backup of course and try it out.
Many thanks.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 17:21
by BillH
David,
I use a tool called Bulk Rename Utility to make mass changes to file names in Windows. Works great. You can find it here.
http://www.bulkrenameutility.co.uk/Download.php
Select your media folder and then use the option
Replace (3) and if you have subfolders in your media folder then also select Subfolders in the option
Filters (12).
I use this all the time and it is very handy. If you have any questions on how to use it let me know.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 17:24
by David Potter
Thanks Mike/Bill
The search and replace plugin worked a treat for renaming the unique part of the Source and Media links. I see Bill has offered up a Windows File rename solution. Thanks Bill, I'll check this out.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 17:26
by BillH
David, I edited my previous reply but you read it before I got it posted. Just a few hints on how to use it. It looks complicated but really I only use about 5 or 10% of its capabilities.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 18:06
by David Potter
Hi Bill
Figured it out - thank you very much. This will for sure save time. Thanks for the recommendation and guidance.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 19:05
by tatewise
This has given me an idea for the Search and Replace Plugin.
When changing Filename links it should also rename the associated Media file itself.
I will look into that.
Re: Rename Selected Media Files
Posted: 28 Nov 2017 22:22
by David Potter
Hi Mike
That would be great - Thank You.
Re: Rename Selected Media Files
Posted: 29 Nov 2017 11:13
by David Potter
Hi Mike
Follow up on your idea. Are you thinking of a way to actually rename the windows media file?
Re: Rename Selected Media Files
Posted: 29 Nov 2017 12:11
by davidm_uk
I think that's what Mike means by describing it as a media file, as distinct from a media record.
Re: Rename Selected Media Files
Posted: 29 Nov 2017 15:36
by tatewise
Yes, whenever a Search and Replace needs to change a Media link to a File then the updated Plugin will also rename the Windows file name &/or folder path too, so the link is not broken.
Try the attached Search and Replace Plugin Version 2.8.1 Date 29 Nov 2017.
[ Attachment deleted as now published in Plugin Store in Feb 2018. ]
BUT before using it do ensure you have taken a File > Backup/Restore > Full Backup (Entire Project Folder) especially since even Edit > Undo Plugin Updates will NOT reverse the Windows folder/file renaming.
Beware that if folder paths are renamed then the original folder(s) will still exist, but may be empty, so will need manual deletion.
I may be able to improve that in a later prototype, but wanted to get some feedback on this first prototype version.
I considered adding a user Option to choose whether the Windows file was renamed or not, but cannot think of a reason why such a setting would ever be needed. Comments please.
Re: Rename Selected Media Files
Posted: 29 Nov 2017 17:42
by David Potter
Thank you Mike
I will put this plugin through testing tonight . Much appreciated.
David
Re: Rename Selected Media Files
Posted: 29 Nov 2017 19:21
by David Potter
Hi Mike
Early tests shows it is absolutely spot on. I'll make more extensive tests tomorrow, but what a time saver, thank you so much.
Re: Rename Selected Media Files
Posted: 30 Nov 2017 14:12
by tatewise
Try the revised attached Search and Replace Plugin Version 2.8.2 Date 30 Nov 2017.
[ Attachment deleted as now published in Plugin Store in Feb 2018. ]
This attempts to delete folders that due to the changes no longer hold any files.
However, it may not clean up an entire nested hierarchy of empty folders.
Such scenarios are rare as they only arise if folder names rather than filenames are changed.
Where appropriate due to the changes, it converts any absolute Media paths to relative Media paths.
During testing it was found that Media FILE tags were not handled along with _FILE tags.
Also the rare PLAC.FORM tags were not identified along with OBJE.FORM tags.
These issues have been resolved and the Extra Filters tab Short Text Field options modified.
Re: Rename Selected Media Files
Posted: 30 Nov 2017 14:30
by David Potter
Thank you Mike.
I will try the revised plugin - I'm not sure I have any of the scenarios mentioned though.
Re: Rename Selected Media Files
Posted: 30 Nov 2017 14:50
by tatewise
Probably not, but it is not difficult to synthesise them in the Family Historian Sample Project.