Script to delete sidecar files for missing photo files?
I'm not sure where to post this as this may be an Apple script, or perhaps a terminal script or something else?
I am currently organizing a photo library (outside of Photos) of some 120,000+ photos with some 50,000+ duplicates in it. I'm using Photo Sweeper to help identify the duplicates but when it deletes it only removes the photo file (jpg, heic, raw etc). If the file has a sidecar (aae, xmp) it is left and orphaned.
I'm trying to find a script or a process that will allow me to find and deleted all .xmp and .aae sidecar files in a folder if there is no matching file name without a .xmp or .aae extension (The matching file may be a .jpg, .heic, .raw, .rw2, .png etc)
For the life of me, while I work in scripts all the time for work in Windows, on MacOS I can't figure out how to start with this. I'm thinking this may be an Apple script, or perhaps something UNIX related to run in terminal?
Any suggestions?
iMac Line (2012 and Later)