* Change Attributes to Events

For users to report plugin bugs and request plugin enhancements; and for authors to test new/new versions of plugins, and to discuss plugin development (in the Programming Technicalities sub-forum). If you want advice on choosing or using a plugin, please ask in General Usage or an appropriate sub-forum.
Post Reply
avatar
Brian
Silver
Posts: 8
Joined: 02 Nov 2023 19:19
Family Historian: V7
Contact:

Change Attributes to Events

Post by Brian »

I have tried using the Change Any Fact Tag plugin to convert attributes to events. However, the attribute value is placed in the event Source Note field. I would like the attribute value to be placed in the event Note field.

If anyone can tell me what changes I would have to make to the plugin to do this, it would be greatly appreciated.

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

Re: Change Attributes to Events

Post by tatewise »

At about line 4133 in the plugin script, it handles new Event or Residence facts where an Attribute value exists.

Instead of "SOUR2" use the "NOTE2" tag, but you must cope with the possibility that a local Note already exists.
If it exists the Attribute value text must be appended to the existing Note text before saving.
Do you need help with how to do that?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Brian
Silver
Posts: 8
Joined: 02 Nov 2023 19:19
Family Historian: V7
Contact:

Re: Change Attributes to Events

Post by Brian »

Thanks Mike,

I made the change suggested and the attribute value was placed in the event note field. However, "Note=" was added as a prefix to the note. Is there a way to prevent this?

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

Re: Change Attributes to Events

Post by tatewise »

It would make things easier for me if you posted the script that you used, so I'm having to guess.
I assume you continued to use fhSetValueAsText(ptrVal,StrOldData.."="..strOldText)
So the variable StrOldData must hold the text Note
Thus fhSetValueAsText(ptrVal,strOldText) should eliminate the prefix.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
avatar
Brian
Silver
Posts: 8
Joined: 02 Nov 2023 19:19
Family Historian: V7
Contact:

Re: Change Attributes to Events

Post by Brian »

Thanks Mike.

It worked great.

Brian
Post Reply