It’s my understanding that file names are not used by AI. Is there a way to automatically copy file names to metadata?
Thanks
Larry
It’s my understanding that file names are not used by AI. Is there a way to automatically copy file names to metadata?
Thanks
Larry
Why would you want to do that? First, the file name is already a meta data (datum?), why copy it? Second, for imported files, the file name has no meaning at all. Third, yes there is a way to copy the filename to a meta data field using a script. Something like
const app = Application("DEVONthink 3");
const records = app.selectedRecords();
records.forEach(r => {
const path = records.path();
app.addCustomMetaData(path, {for: "Filename", to: r});
})
This JavaScript script works on the selected records and adds the file name to a user meta data field called “Filename”. It (the script) is not tested, so use at your own risk and make sure to test it on copies of your data before putting it to general use.
I actually think that could be done with a simple smart rule. In the image below, my custom metadata is called Sortierung; obviously I would use Filename or similar for the purpose at hand:
That rule should scour the databases adding the file name to custom metadata for any file for which that custom metadata is currently empty.
That is correct. Filenames, like other names, are variable and malleable. If you add the filename as metadata, what happens if you change the filename? Does it matter to you if they’re out of concert then?
The method to my madness is, and correct me if I’m wrong, is that file names are not used by the AI and, for the most part, I’ve made my filenames to be indicative of the content.
Therefore, I’m viewing it as one more way to tell the AI engine about my intended content of the file.
Is my thinking misguided???
Not at all.
But my question stands: If you add the filename as metadata, what happens if you change the filename? Does it matter to you if they’re out of concert then?
A Smart Rule with trigger On Rename
could keep custom meta data up to date.
True enough.