You can import a ready-made example from here: https://eu.eyeauras.net/share/S20240223231042V9jd1AoFcJ6v
var trigger = AuraTree.FindAuraByPath(@".\TextSearch") // find the aura by name
.Triggers.Items // iterate through all triggers
.OfType<ITextSearchTrigger>() // find triggers of type "Text Search"
.First(); // take the first one; an error will occur if not found
var matchResult = trigger.Refresh(); // force the trigger to perform the search
Log.Info($"Text: {matchResult.Detected.Text}");