On Thursday, June 11, 2020 at 6:02:15 PM UTC-7, Stallings wrote:
>
> 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
>
<$list filter="[{!!bibtex-annote}*allafter[M)]*split[{\textbar}]butlast[]]" 
> variable="this-annote">
> 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}*regexp[allafter[M)]]*split[{\textbar}]butlast[]]" 
> variable="this-annote">
> but that was just a shot in the dark.
>

Here's an updated "Annotation Parser" that removed the leading text:
\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>

notes:
* the $set widget uses a filter to split the bibtext-annote content at the 
"M)", producing a list of two items.  It then discards the leading 
"Extracted Annotations (date, time)" content by selecting item 1 from the 
list (the *second* item, because lists are 0-based)
* the $list then uses the <trimmed-annote> variable as input, rather than 
the previous bibtext-annote field value
* I also changed the tm-new-tiddler $param value from a literal "New 
Annotation" to a macro that constructs the new title by appending 
"Annotation" to the current tiddler title.  Thus, when parsing "Arons et al 
2020" from your example, you will get three new tiddlers, entitled "Arons 
et al 2020 Annotation", "Arons et al 2020 Annotation 1" and "Arons et al 
2020 Annotation 2".

again, give it a try and let me know how it goes...

enjoy,
-e

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to tiddlywiki+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/c85896d0-3d0c-40ce-9b26-996b8b245c8ao%40googlegroups.com.

Reply via email to