No… it is not.
I took another screenshot, this time with a monospace font, and you can see the “ANF-” perfectly aligned in the 4th and 5th row, while the attribute says “23” for the 4. row and “25” for the 5. row…
That is also the point, where the “ANF-” becomes “F-”
Edit: When I delete one of the spaces after the AW_ at the beginning and add again one space, then the 25 becomes a 23 and the result is correct. But only with the second one (of two). BTW, those $Names are file names of a watched folder, so those spaces are part of the file name. Perhaps that helps…
Also cutting the complete name and re-pasting does the trick.
But it should somehow work automatically
Ah – I bet I know the problem. As I recall, find() and substr() don’t know about (fairly unusual) unicode code points that require 2 words in UTF-16 and 4 in UTF-8.
This is a case for using regular expressions. If think something like
$Name.contains(“.(ANF.)_”)
would leave your code in $1, ready to be stored where you want it.
Interesting as I thought that when titling a note (manually), Tinderbox discarded leading spaces. I guess the leading spaces in the names here were due to some other means of creation, such as file import?