Filter (Subfolder) within another filter, unexptected result

I think you're running into a technicality with how the Sub-Folder clause works.

Sub-Folder is special/unique and exists to solve a particular problem. Its purpose is to short-circuit a filter so that it stops looking when it reaches a certain directory. (That being quicker than going inside a directory and looking at every file & folder below it if when you know you're going to reject all of them. More about that here.)

The problem here is that you've got a filter-in-a-filter and it's the inner filter which gets short-circuited. (The Sub-Folder clause short-circuits the filter it's a part of.) The outer filter isn't affected and, since the inner filter doesn't have anything but the Sub-Folder clause, the inner filter doesn't really do anything at all.

What you've tried to do seems completely reasonable, though. You shouldn't have to know the intimate details of how Sub-Folder is implemented in order to use it.

I don't think anyone has noticed/raised this before, so I've sent a report to GPSoftware.

(BTW, thanks for writing such a clear post! The examples & screenshots had just the right details to understand what was going on.)

1 Like