* Data Structure
Data Structure
Hi
Can anyone tell me where I can info on the Data Tree Structure, particularly for Objects.
I'm thinking of writing a small plugin to correct some errors but first I need to know thename of the 'fields' that I need to seearch and then correct.
Thanks
D
ID:7022
Can anyone tell me where I can info on the Data Tree Structure, particularly for Objects.
I'm thinking of writing a small plugin to correct some errors but first I need to know thename of the 'fields' that I need to seearch and then correct.
Thanks
D
ID:7022
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Data Structure
Checkout the Knowledge Base Glossary for GEDCOM that has online and PDF links.
Also look at the Knowledge Base Family Historian Plugins ~ Developer Guide.
You might even find an existing Plugin that almost does what you want and can be quickly edited.
Also look at the Knowledge Base Family Historian Plugins ~ Developer Guide.
You might even find an existing Plugin that almost does what you want and can be quickly edited.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
- Jane
- Site Admin
- Posts: 8442
- Joined: 01 Nov 2002 15:00
- Family Historian: V7
- Location: Somerset, England
- Contact:
Data Structure
It's also worth remembering that on the Plugin Editor you can select fields using Edit>Insert Data Reference which will give you the tags and structure lists you need. What I often do it put the data reference in a comment line while I am building the access.
Jane
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
My Family History : My Photography "Knowledge is knowing that a tomato is a fruit. Wisdom is not putting it in a fruit salad."
Data Structure
Thanks Jane
Exactly what I wanted.
What I am trying to do is change OBJE._FILE field from the currnt value (Mediahttp://ancestry.com/xxxxx) to MediaOBJE.TITL..OBJE.FORM).
This should remove the link to media located on Ancestry and repalce is with the media located in the Media folder.
Now need to work out how to overwrite the existing vaule.
Any help welcomed
[grin][grin]
D
Exactly what I wanted.
What I am trying to do is change OBJE._FILE field from the currnt value (Mediahttp://ancestry.com/xxxxx) to MediaOBJE.TITL..OBJE.FORM).
This should remove the link to media located on Ancestry and repalce is with the media located in the Media folder.
Now need to work out how to overwrite the existing vaule.
Any help welcomed
[grin][grin]
D
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Data Structure
This should do it, but beware of invalid filename characters in the Multimedia Title.
Code: Select all
ptrObje = fhNewItemPtr() -- Declare pointer
ptrObje:MoveToFirstRecord('OBJE')
while ptrObje:IsNotNull() do -- Loop through OBJE records
local ptrTitle = fhNewItemPtr()
ptrTitle:MoveTo(ptrObje,'~.TITL')
local strTitle = fhGetValueAsText(ptrTitle) -- OBJE.TITL
local ptrForm = fhNewItemPtr()
ptrForm:MoveTo(ptrObje,'~.FORM')
local strForm = fhGetValueAsText(ptrForm) -- OBJE.FORM
local ptrFile = fhNewItemPtr()
ptrFile:MoveTo(ptrObje,'~._FILE')
local strFile = fhGetValueAsText(ptrFile) -- OBJE._FILE
if strFile:match('http://trees.ancestry.com') then -- Ancestry link found
fhSetValueAsText(ptrFile,'Media\'..strTitle..'.'..strForm) -- Need \ as is an escape character
end
ptrObje:MoveNext()
end
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Data Structure
Mike
MANY MANY THANKS
That seems to have worked for 95%+ of the media. So just a little tidying up to do.
This now means that I can succesfuly export a gedcom from Ancestry and then correct the media file path to the locally stored images. On my Test Project that is 1200+ media images corrected almost in one go.
Again. Many thanks
Dermot
MANY MANY THANKS
That seems to have worked for 95%+ of the media. So just a little tidying up to do.
This now means that I can succesfuly export a gedcom from Ancestry and then correct the media file path to the locally stored images. On my Test Project that is 1200+ media images corrected almost in one go.
Again. Many thanks
Dermot
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Data Structure
Glad that worked OK.
Would it be normal for each Media Filename to match the Media Title in Ancestry, or is it just that you have organised it that way??
If it is commonplace, then that Plugin may be of general use and added to the Plugin Store.
Alternatively, I could add it as a feature of the Check and Repair Media Links Plugin that I am updating at present.
Would it be normal for each Media Filename to match the Media Title in Ancestry, or is it just that you have organised it that way??
If it is commonplace, then that Plugin may be of general use and added to the Plugin Store.
Alternatively, I could add it as a feature of the Check and Repair Media Links Plugin that I am updating at present.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Data Structure
Not sure how standard this would be or if it is just the way I do things
My practice is to store all images locally on my PC before uploading them to Ancestry. Before uploading, they are named according to my conventions.
When uploaded to Ancestry they appear in Ancestry with the file names I have given them.
When the gedcom is download from Ancestry and imported to FH, the media records show the correct file name (OBJE.TITL) and format (OBJE.FORM) but the file path is given as a link to the Ancestry tree, i.e. http://trees.ancestry.com/...... etc. This link does not include my file name, just an alphanumeric link, i.e.
Mediahttp://trees.ancestry.com/rd?f=image&guid=54f30558-07dc-4e41-a56f-251fbb4ef9c&tid=41599612&pid267
All I need to do is copy my local image into the FH Media folder and then run the script you have created. This will now overwrites the Ancestry path and replacing it with my filename.
Really need to check with other users to determine if this is normal practice.
The tidying up I am having to do is really only where the online file name is different from my local file name. This has occured because I have either modified one and then not made the same change to the other record. Also I have found a number of records which have an extra space at the end of the file name before the file extension. Some simple editing and all is back in sync.
Again many thanks. Your script will save me having to manually edit several thousand media records.
Dermot
[grin]
My practice is to store all images locally on my PC before uploading them to Ancestry. Before uploading, they are named according to my conventions.
When uploaded to Ancestry they appear in Ancestry with the file names I have given them.
When the gedcom is download from Ancestry and imported to FH, the media records show the correct file name (OBJE.TITL) and format (OBJE.FORM) but the file path is given as a link to the Ancestry tree, i.e. http://trees.ancestry.com/...... etc. This link does not include my file name, just an alphanumeric link, i.e.
Mediahttp://trees.ancestry.com/rd?f=image&guid=54f30558-07dc-4e41-a56f-251fbb4ef9c&tid=41599612&pid267
All I need to do is copy my local image into the FH Media folder and then run the script you have created. This will now overwrites the Ancestry path and replacing it with my filename.
Really need to check with other users to determine if this is normal practice.
The tidying up I am having to do is really only where the online file name is different from my local file name. This has occured because I have either modified one and then not made the same change to the other record. Also I have found a number of records which have an extra space at the end of the file name before the file extension. Some simple editing and all is back in sync.
Again many thanks. Your script will save me having to manually edit several thousand media records.
Dermot
[grin]