In the first part you talk about a stamp but then mention a problem with an agent. How does the agent come into this?
As I recall from the meet-up, you have successfully converted the comma+space delimited list from DEVONthink to a Tinderbox-style semicolon-delimited list. For example reference (but using English list items here!), you got a list from DEVONthink “ant, bee, cow
” and stored it in a Tinderbox Set-type attribute $DT3_Alaises. We ‘fixed’ the list formatting with this code:
$DT3_Alaises = $DT3_Alaises.replace(", ",";");
That replaces every comma+space pair of characters with a single semicolon. This turns what a single Set value of all the terms, into a true Tinderbox list.
I also recall you saying you had used the list-format to-$text-and-Explode method to make a note per DEVONthink term in the list. Furthermore you want to connect (whether by a link or in metadata) each of these glossary terms with the note where it occurs. Is this correct? I ask only so we can start to correctly define the process so we can test the steps:
$Text.icontainsAnyOf($DT3_Aliases("αἴσθησις"))
In an agent query, the above will be true
, and create an alias in the agent, if any one of the value(s) in the $DT3_Aliases of the note called ‘αἴσθησις’ matched any word in the $text of the note being processed by the agent.
So, if $DT3_Aliases is ‘ant;bee;cow’, $Text of “Oh to be a bee” would be a match (on the value bee
) but a $Text of “The birds and bees” would not give a match (‘bees’ contains the substring ‘bee’ but is not an exact match for ‘bee’
A stamp that would take the value of the note’s attribute
Do you mean the $DT3_Aliases value(s) of the note being stamped? In which case you use
$Text.icontainsAnyOf($DT3_Aliases)
As we want the $DT3_Aliases of this note and not the note called ‘αἴσθησις’
and query for any one of the attribute’s values.
$Text.icontainsAnyOf($DT3_Aliases)
As explained above, this text will give a true
test result if any whole word in $Text matches (here case-insensitively) any whole list value in $DT3_Aliases.
Then it would add aliases of the results to the note as children.
A stamp can’t do this, and furthermore the above .icontainsAnyOf()
test simply tells you if one or more words have been matched; either the same $Text word several times, or different $Text words. The test doesn’t tell you which actual list values were matched. Thus this won’t tell you what aliases to make.
I think at this point, the sensible thing is to develop proof the process in a smaller test document. that way if you mess up, no great harm is done. Indeed if you do all you new tests on a copy of the text document you simply throw away bad tests and start over. I also noted (in the meet-up) that the DEVONthink derived list of terms (the comma separated list) has many items. For initial testing, 5 or 10 terms would suffice (rather than 50 or 100).
I supsect that what you really want to do is is add an alias to a glossary term note as a child of a research note for every glossary term in that note. So if a note’s $Text contains 3 discrete glossary terms, you would expect to end up with 3 aliases as children of the note? Is that correct?
Sorry for all the detail and questions, but I recall you say your thesis deadline is looming and we’d like to help you get this problem fixed. 