Hellp to all,
I have an a-old bunch of notes with a List attribute called $Mots (words in French) that contains a list of keywords.
I wrongly was separating these keywords by a “,” (a comma). Want to change these to a “;” semi-colon.
I tried to create an agent that collects these notes et modifies the content of the List attribute
Query:
$Mots.contains(",")
but it doesnt work.
Throught it was a GREP issue, so I tried:
$Mots.contains(",") [that is a inverted slash+the comma]
it doesnt work either.
The idea is once this group of notes is identified, to have a simple: Rule or Action:
$Mots=$MyList.replace(".",";")
Yes, that would not work for the reason explained here: when working on a list (List or Set type), the .contains/.icontains operators can only match entire list values. Don’t feel bad - I was only reminded of this on checking aTbRef after testing your comma query and confirming it didn’t work!
Consider my test with the $Mots with contents “ant;bee,cow”, i.e. it holds two values ‘ant’ and ‘bee,cow’. Thus $Mots.contains() can only match ‘ant’ or ‘bee,cow’. A single character cannot be matched.
The answer to using an agent is to use some other method to gather the notes. For instance the query $Mots will gather all notes that have a value for $Mots. Now we can run the stamp code above as the agent action.
The action will act on all aliases in the agent. This is not a problem as the action only replaces unwanted commas. Notes matching the query that have no such commas are not affected.
Great ! Thank you very much Mark – mystery solved.
The stamp method is more in line with the “Tinderbox spirit”, that is gardening, rather than automatizing everything. I’ll have to review one by one my notes and continue gardening.