Advanced Find Help with Multiple And Or's

Found myself with another road block on this same process.

This is working for me if I
Find folders that have a matching string in full path
AND Type Is Folder
And Script Has JPG

It works great.
But If I try to do this with 1 advanced search to look into other folders too, doing the same process it only finds first set of folders.

I think the screen shot will explain it more.

The rules in green work, and those folders are found.

The second group of rules in red are not found. If I disable the first three rules, then the second group works. So I sort of assume I am doing an order of operations wrong. Anyone have any ideas?

You need to use Subclause to group/bracket the two sets of operations.

With normal boolean logic, you need brackets any time you mix "and" and "or" together. Subclause is like brackets for the advanced filter control.

You want (A and B and C) or (D and E and F) but what you have might turn into
(A and (B and (C or (D and (E and F))))) or
(((((A and B) and C) or D) and E) and F).

(I'm not actually sure which it turns into. It's best to not avoid the situation entirely and not rely on either happening, as it's ambiguous in any case.)

Here's the right way:

(I've used a different script column as I don't have that one.)