\define annoTags() [[$(currentTiddler)$]] Annotation
\define annoTiddler() $(currentTiddler)$
<$button>
<$action-sendmessage $message="tm-new-tiddler" title="New Annotation" tags=<<annoTags>> text={{!!bibtex-annote}}/>
Pull annotations
</$button>I'd like to turn the value of a field ("bibtex-annote") into the content of multiple new tiddlers for later use/transclusion. Right now, I am able to copy the entire value to a single new tiddler with this button (adapted from here):\define annoTags() [[$(currentTiddler)$]] Annotation
\define annoTiddler() $(currentTiddler)$
<$button>
<$action-sendmessage $message="tm-new-tiddler" title="New Annotation" tags=<<annoTags>> text={{!!bibtex-annote}}/>
Pull annotations
</$button>This works, but obviously is incapable of parsing the value into multiple tiddlers. Here's the value:Extracted Annotations (6/11/2020, 8:20:28 AM)"Infection-control strategies focused ... into this facility." (Arons et al 2020:1){\textbar}"The median ... (interquartile range, 3 to 5)." (Arons et al 2020:3){\textbar}Which should return two tiddlers:"Infection-control strategies focused ... into this facility." (Arons et al 2020:1)"The median ... (interquartile range, 3 to 5)." (Arons et al 2020:3)
\define annoTags() [[$(currentTiddler)$]] Annotation
<$button>
<$list filter="[{!!bibtex-annote}split[{\textbar}]butlast[]]" variable="this-annote">
<$action-sendmessage $message="tm-new-tiddler" $param="New Annotation" tags=<<annoTags>> text=<<this-annote>>/>
</$list>
Pull annotations
</$button><$list filter="[is[current]!field:bibtex-annote[]]">
{{||Annotation Parser}}
</$list><$list filter="[{!!bibtex-annote}allafter[M)]split[{\textbar}]butlast[]]" variable="this-annote">
<$list filter="[{!!bibtex-annote}regexp[allafter[M)]]split[{\textbar}]butlast[]]" variable="this-annote">
I tried to remove "Extracted Annotations (6/7/2020, 1:57:43 PM)" from the beginning of the string (that bit always ends with "AM)" or "PM)" with
but that didn't work, I assume because it was expecting an item in a list, rather than a regular expression. Nesting didn't work, either:<$list filter="[{!!bibtex-annote}allafter[M)]split[{\textbar}]butlast[]]" variable="this-annote"><$list filter="[{!!bibtex-annote}regexp[allafter[M)]]split[{\textbar}]butlast[]]" variable="this-annote">but that was just a shot in the dark.
\define annoTitle() $(currentTiddler)$ Annotation
\define annoTags() [[$(currentTiddler)$]] Annotation
<$button>
<$set name="trimmed-annote" filter="[{!!bibtex-annote}split[M)]]" select="1">
<$list filter="[<trimmed-annote>split[{\textbar}]butlast[]]" variable="this-annote">
<$action-sendmessage $message="tm-new-tiddler" $param=<<annoTitle>> tags=<<annoTags>> text=<<this-annote>>/>
</$list>
</$set>
Pull annotations
</$button>
\define annoTitle() $(currentTiddler)$ Annotation
\define annoTags() [[$(currentTiddler)$]] Annotation
<$button>
<$list filter="[{!!bibtex-annote}split[M)]butfirst[]split[{\textbar}]butlast[]]" variable="this-annote">
<$action-sendmessage $message="tm-new-tiddler" $param=<<annoTitle>> tags=<<annoTags>> text=<<this-annote>>/>
</$list>
Pull annotations
</$button>