* Changing File Names

Questions regarding use of any Version of Family Historian. Please ensure you have set your Version of Family Historian in your Profile. If your question fits in one of these subject-specific sub-forums, please ask it there.
Post Reply
avatar
jeremyhills
Diamond
Posts: 96
Joined: 28 Dec 2003 17:05
Family Historian: V6

Changing File Names

Post by jeremyhills » 22 Aug 2017 16:54

I seem to remember there is a way of changing file names that keeps the links. For example, I have a number of files in the style of "John Smith" and I would like to change them to be "Smith, John" but retain the links they have already got. Any ideas? Jeremy

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing File Names

Post by tatewise » 22 Aug 2017 17:48

You must change the name of the file using Windows File Explorer and at the same time change the Linked File name within the associated Media record via the Records Window.

A slightly different method is to find the Media item in the Media Window.
Double-click the thumbnail on the right and on the Media Record tab click the blue folder link shown against Location.
That will open Windows File Explorer with the file highlighted to allow it to be easily Renamed.
Then double-click the Media Record highlighted on the left and in the Property Box change the Linked File name.

If done correctly the Media image will still be shown. If not then you will get File not found or X errors.

On reflection Jeremy, I wonder if you are actually talking about the Media record Title?
If so, then that can be changed without affecting links or file-names.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Changing File Names

Post by Jane » 23 Aug 2017 07:08

I wrote a plugin ages ago which renames media to match the title of the media record, excluding any characters not allowed in a filename.
Attachments
Rename Selected Media Files.fh_lua
(1.37 KiB) Downloaded 211 times
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
davidm_uk
Megastar
Posts: 740
Joined: 20 Mar 2004 12:33
Family Historian: V7
Location: St Albans, Hertfordshire, UK

Re: Changing File Names

Post by davidm_uk » 23 Aug 2017 08:23

Jane - that plugin looks to be VERY useful - does it still work ok with the current version of FH?
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Changing File Names

Post by Jane » 23 Aug 2017 09:35

Can't think of any reason why it shouldn't work. Try it on the Sample Project if you want to play you can always reset that
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

User avatar
tatewise
Megastar
Posts: 27088
Joined: 25 May 2010 11:00
Family Historian: V7
Location: Torbay, Devon, UK
Contact:

Re: Changing File Names

Post by tatewise » 23 Aug 2017 10:42

The only caveat is if your Media Title happens to include accented/foreign characters not in the ANSI character set then the filename will have a few unusual characters in their place.

Note that it also prefixes the Title with the letter O the Record Id and an underscore so the full filename will be like:
O123_Media-Title.jpg

All the above can be fixed with a few minor modifications to the Plugin.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry

User avatar
davidm_uk
Megastar
Posts: 740
Joined: 20 Mar 2004 12:33
Family Historian: V7
Location: St Albans, Hertfordshire, UK

Re: Changing File Names

Post by davidm_uk » 23 Aug 2017 12:15

Thanks, I'll have a tinker with the plugin.

I always have the same "title" for source record, media record and filename. Helps me find things easily.
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)

avatar
jeremyhills
Diamond
Posts: 96
Joined: 28 Dec 2003 17:05
Family Historian: V6

Re: Changing File Names

Post by jeremyhills » 24 Aug 2017 08:37

Would you be able to let me know when you have tinkered?! Jeremy

User avatar
davidm_uk
Megastar
Posts: 740
Joined: 20 Mar 2004 12:33
Family Historian: V7
Location: St Albans, Hertfordshire, UK

Re: Changing File Names

Post by davidm_uk » 24 Aug 2017 11:08

Yes OK, might be a few days, bit tied up with other things at the moment.
I haven't looked to see what the plugin does in the way of error checking (eg. if there's already a file with the new name), but all I'm intending to do is modify it to leave off the prefix (eg. O123_) .
David Miller - researching Miller, Hare, Walker, Bright (mostly Herts, Beds, Dorset and London)

User avatar
Jane
Site Admin
Posts: 8442
Joined: 01 Nov 2002 15:00
Family Historian: V7
Location: Somerset, England
Contact:

Re: Changing File Names

Post by Jane » 24 Aug 2017 11:44

Just a word of caution, as the Plugin does not check for duplicates, so make sure you don't have more than one Media with the same Title. Adding the Object Rec Id number avoids that problem.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."

Post Reply