For the first example, I wasn’t actually suggesting the part about using whose over using keys (“A”;“B”), I was actually referring to the rest of the relevance after that. I just copy and pasted the whose part.
For the 2nd example, I would recommend using the plural files instead because it prevents it from throwing an error. It makes more sense like this:
exists lines whose(it starts with "STRING") of files "a.txt" whose(exists lines of it) of folders "C:\temp"
files should be plural because the file may not exist. It ensures a true/false value rather than an error.
Again, this is my general recommendation, all relevance should be plural wherever possible.