* Display Media File Name only

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
User avatar
Vyger
Platinum
Posts: 41
Joined: 15 Jan 2019 12:11
Family Historian: V7

Display Media File Name only

Post by Vyger » 22 Oct 2022 14:02

I hoping one of the FH experts can answer here but at present I am guessing it is just not possible.

I maintain a media collection carefully named to a standard I adopted many years ago, Ancestry and other crazy file names often invade my collection and I want to filter and resolve these using the new Rename options.

The problem I have hit is one of displaying Media File Name only as a column, I see the Right, Left and Mid functions but no way to calculate the split from the string? In VBA what I am looking for would be best described below but there is no InStr function I can find in FH

Mid(OBJE.FILE, (InStrRev(OBJE.FILE, "\")) + 1)

Am I right in making the assumption this cannot be done?

Thankfully FH displays file name only in the Title where a Custom Title has not yet been added by the user.
Genealogy Reviews - research methods for a more productive future

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Display Media File Name only

Post by ADC65 » 22 Oct 2022 16:46

I think the function FindText does this ... have a look here:

https://www.family-historian.co.uk/help ... dtext.html
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
ColeValleyGirl
Megastar
Posts: 4850
Joined: 28 Dec 2005 22:02
Family Historian: V7
Location: Cirencester, Gloucestershire
Contact:

Re: Display Media File Name only

Post by ColeValleyGirl » 22 Oct 2022 18:25

I believe that you need to use a function (FieldText or GetFieldText?) to access the file path/name FILE.OBJE as a text string; and then use the Section function to split it first at the last path separator and then at the "." between name and extension.

However, I can't get the exact syntax right (every time I use a data reference I have to go back to basics), and I could be completely wrong.

User avatar
ADC65
Superstar
Posts: 376
Joined: 09 Jul 2007 10:27
Family Historian: V7

Re: Display Media File Name only

Post by ADC65 » 22 Oct 2022 23:32

A quick experiment shows that:

Code: Select all

=FindText(%OBJE.FILE[1]%,"\")
will return the position of the first backslash character. You can then use MID or SECTION to grab the text you need. The difficulty for me is that my File shows multiple backslashes for directory nesting, and they have different levels, eg:

Code: Select all

Media\Census\UK Census 1921\UK Census 1921 - Wales, New Tredegar, 27 Pritchards Terrace.jpg
Media\Census\Non UK\US\1950\US Census 1950 - Pennsylvania, Blair, Altoona, 228 22nd Avenue.jpg
And I couldn't figure how to distinguish the last blackslash.
Adrian Cook
Researching Cook, Summers, Phipps and Bradford, mainly in Wales and the South West of England

User avatar
David2416
Superstar
Posts: 378
Joined: 12 Nov 2017 16:37
Family Historian: V7
Location: Suffolk UK

Re: Display Media File Name only

Post by David2416 » 23 Oct 2022 06:47

There could be multiple \ and multiple dots. Get the string length, find last dot position and last\ position then you use a mid string function. Might help to reverse the string.

Post Reply