FieldQuery is documented
https://wiki.jriver.com/index.php/Accessing_and_Storing_Functions#FieldQuery
I do not think this function will be useful to you in either of those scenarios though. Depending upon what/how many fields you're searching in, global use of FieldQuery has the potential to bring MC to its knees.
Thanks for the documentation link - I did not find it a few days ago
Zybex pointed me to FieldQuery():
The FieldQuery() function can be used for that (undocumented, but explained here). It finds files that share some tag value and then returns the value of another tag of that file. In your case, we can use it to get the [TAGGINGTIME] of an Audio file sharing the same [Filename (path)].
I just tested it and hit an issue - the function doesn't allow to limit the search to only Audio files, so it may find the Image file itself, which will have an empty TAGGINGTIME. However, there's a workaround.
You can try the direct function first - it will probably work for most of your files, but perhaps not all:
- Use this expression on the [TAGGINGTIME] field of the Images you need to tag:
=listitem(fieldquery(Filename /(path/), [Filename (path)], TAGGINGTIME, 1, 0), 0)
If that doesn't work you need to do this:
- create a new Field called "Type:Folder", Calculated, with expression="[Media Type]:[Filename (path)]"
- use this expression for the [TAGGINGTIME] of the images:
=listitem(fieldquery(Type:Folder, Audio:[Filename (path)], TAGGINGTIME, 1, 0), 0)
if you get a number instead of a Date, you'll need to add a FormatDate:
=FormatDate(listitem(fieldquery(Type:Folder, Audio:[Filename (path)], TAGGINGTIME, 1, 0), 0), date)
I think it would really improve the FieldQuery() documentation to include Zybex's two excellent examples shown above, which totally solved my puzzler, as described here
https://yabb.jriver.com/interact/index.php/topic,129618.msg899369.html#msg899369I found it to be very quick for my modest data set (~5000 tracks) on a Win10 Intel NUC 8i5BEH. Apparently it moves values between libraries without reading the audio files. For a much larger collection, I imagine it may sit there spinning for a few minutes. It would be nice if FieldQuery() put up a spinning wheel message while it was working.
My application re using it as a "Tag on Import" rule would be to keep an Image library synchronized to an Audio library. I just set up an Image library monitoring my Music file directory structure, so that all the cover art images etc. are available in a global glance in the Image library. Works great for "Recently Added", "Year (released)", and "Artists" views as long as the directory structure is shallow. I also wanted "Last Played", but that is not a user writable field and "Last Played" means something very different for music and images - might work with a custom field though. Yes, it could be slow if you import an entire library, but normally only a few albums get added/changed at a time.
So now we're down to the OP Item (1)