I am trying to watch all sub-directories starting with my document package bundle on macOS, but I can only get NSMetadataQuery to report files in the immediate directory used for the scope. It does not do a recursive search.
I am trying to watch for a list of files and their download status contained within my file package (NSFileWrapper *) which is stored on iCloud Drive (or anywhere the local FS), but I can only get NSMetadataQuery to return the files directly in the directory passed as a scope. It doesn't do a recursive search.
Here is the only thing I could get working:
_query = [[NSMetadataQuery alloc] init];
NSString *root = [_DocRoot path];
[_query setSearchScopes:[NSArray arrayWithObject:root]]; // /Users/patrick/MyFDPackageBundles
[_query setPredicate:[NSPredicate predicateWithFormat:@"%K LIKE '*.fd'", NSMetadataItemFSNameKey]];
[NSPredicate predicateWithFormat:@"%K LIKE '*'", NSMetadataItemFSNameKey]