Moving from Mariner Paperless to DevonThink

In my previous post, I was a bit off target. DT records have a metadata property that should contain the keywords in your case.
So, in the function addDocument, add this at the end (not tested, since I don’t have appropriate documents), replacing newRecord.name = title;

const keywords = newRecord.metaData().kMDItemKeywords.split('\n');
const kwName = keywords.filter(k => k.includes('Name');
if (kwName && kwName.length) {
  const name = kwName[0].split('=')[1];
  newRecord.name = name;
}

This snippet assumes that

  • the metaData property contains a kMDItemKeywords key. If that’s not always the case, you must check for its existence before applying split to it.
  • the kMDItemKeywords entry contains keywords separated by newlines. If that’s not the case, change split('\n') accordingly
  • the Name entry in kMDItemKeywords contains the name you’re after
  • The string Name and the name itself are separated by a = sign. If that’s not the case, change split('=') accordingly.

The Paperless people must have been a bit weird, storing the dates in US format (the most illogical of all possible formats). But then their AppleScript implementation is borken, and they still sell their software in the App Store although the company has disappeared.