I am very much a novice at this agent/action/stamp business and I am not able to get the $Text.eachline() statement to work. I was working off the example from the July 13 Tinderbox Meetup where Michael Becker was using this statement in his example.
My use case: I have imported several Kindle Highlights from Obsidian with YAML properties that have the same attribute names in Tinderbox. I am attempting to parse the $Text in Tinderbox which contains those lines of YAML properties. My approach, in a stamp so far, is as follows:
$Text.eachline(aLine) {
if (aLine.contains("zIndexTerm")) {
$zIndexTerm=aLine.substr(12);
};
};
Where there is a line in the $Text attribute zIndexTerm Insulin Resistance Symptoms
The resolution on my computer screen makes it very difficult to replicate the patterns in the Tinderbox Meetup YouTube (around time stamp 1:30) to distinguish parentheses from brackets from semi-colons.
I suspect there is something outside of this action in a stamp that is affecting the conditional if (aLine.contains(āzIndexTermā)){} as it never becomes true.
I have retyped that line in the $Text attribute to eliminate the possibility that there are hidden characters in the text to prevent a positive match.
The operator is .eachLine(), with an interstitial capital āLā. Operator names are case-sensitive so using .eachline() fails. Generally, action operators that are compunded words inter-capialtise the word boundary, thus āeach+lineā ā āeachLineā.
Using your code with the correct syntax works for me. Run stamp āTestā on āA noteā in this demo file: eachLine-demo.tbx (167.2 KB)
Thank you very much. Another example, for me, of staring at something for days and just not seeing what I was looking at. Yes, I have made extensive reference to aTbRef but just failed to pick up the essence of the camel-case syntax in this case. And yes, it certainly does work for me now. A major roadblock for me has now been overcome. Again, thank you. A second pair of eyes is invaluable.
For example, here Iām experimenting in the Rule Inspector (a place that has the colouring described above). First as you type (and after at least 3 characters you may see an autocomplete):
Next, if you type an operator name incorrectly (including case), it wonāt colour blue (see link above for colour meanings):
Unbalanced brackets are also highlighted. I edited the above showing a closing parenthesis and an opening curly bracket highlighted as its opening/closing partner canāt be found.
Be aware that you might be using strings that are adding single brackets so the latter can sometimes indicate a missing partner. In the example below, we can see there is no error but the regex doing the colour code cannot (such methods have limits - this isnāt a programming IDE!):
Anyway, the colouring is another thing to consider if staring at code that ought to work but doesnāt seem to.