This was fun to do!
Alright, so there is a solution here to replace email addresses in a given note with an Agenda person tag, but it’s a two-parter:
- First, you need to have some way of telling Agenda and the world what Person tag equates to what email address.
- Second, you need to bash a given note up against the relationships you defined in part 1 to be able to make the necessary subsitutions.
I went about part 1 using the amazing Data Jar app, which allows you to build simple dictionaries for regular reuse (it’s free and doesn’t collect user data, so while it might be another thing to install, there is no financial or privacy cost).
This Agenda People Tag Builder shortcut might need some editing for you to work, but is set up to look through your contacts for anyone with an accenture.com
email address, and then makes dictionary values using that contact’s first and last name, in the Agenda tag structure of @(First Last)
. So that assumes a bit about your contacts and how you name your tags, but it’s a relatively painless way of building said database.
Also, because this is making a JSON dictionary, you could run and rerun the shortcut and not end up with duplicates, because it will just overwrite existing values with the same data.
You can also just make a dictionary in Data Jar by hand, so long as the path is Agenda.People
. You can add entries to Data Jar directly to make or expand the dictionary (the key is the Agenda person tag and the value for that key is the email addess).
With that dictionary made, you can now use the Agenda People Tag Replacer shortcut by sharing a given note to it as markdown (the markdown bit is important). I use markdown because any email address in the note is going to be linked, so we need to replace that full link properly ([someone@somedomain.com](mailto:someone@somedomain.com)
) with just the Agenda tag. Share your note to the shortcut, and voila.
There is no penalty for email addresses with no equivalent tags as defined in the dictionary made earlier, because only positive matches are replaced.
Another little side note is that the replacement doesn’t demand case sensitivity for email addresses. Some systems like to capitalize for fun, and I thought it would be best to ignore casing to make sure matches occur as expected.
Would love to hear what you think of this, open to any feedback to imprave this!
ScottyJ