Without testing, but reading the manual, I think the parentheses should do the trick. The Reference Guide says the following:
The and/or operator determines the relationship between adjacent criteria
which means that there is no default grouping (precedence).
You should also have parentheses grouping the four 'ID starts with' tests together if I'm seeing straight.
😉
I think you want generically these parentheses:
((window-criteria) OR (door-criteria)) AND (ID starts with 0, 1, 2, 3)
note that the window OR door is itself grouped so that the AND applies to the group, not just to doors....although maybe the numeric ID prefix does only apply to doors...
One of the forum moderators
AC 28 USA and earlier • macOS Sonoma 14.7.1, MacBook Pro M2 Max 12CPU/30GPU cores, 32GB