Yes, it is. Here’s a modified version that adds the modification date of the record to the output. It also changes the delimiter from semicolon to comma.
To store it, unzip the file to get an scpt file, go into the script menu, click Open Scripts Menu, and store this file in the export directory. Export Metadata as CSV.scpt.zip (8.38 KB)
Thanks for doing that, Alan. I’d suggest using the semicolon delimiter to avoid those situations where Name or Comment contains commas. For documents that originated as clippings from web pages, it is not uncommon to have commas in names. And of course people use commas in comments frequently.
I was trying to run this script on a group I have for a chronology of events.
When I select all records in the group and run the script, I get a message “Can’t get of missing value”.
If I run the script on records individually, some get exported; others just generate the same dialog as above. I don’t know what it is about the individual records that is different.
I don’t know what class DTpl is or what value it is looking for?
“DTpl” is the plain text version of the contents of a document – and that class is used in a case in the script where the code finds an “x-devonthink-item” link in the URL field of another document, assumes that the URL links to an annotation record, and then attempts to find the plain text of that annotation. (One of the columns of output in the CSV is the content of any annotations that a document contains.) What happens when the script fails is that there is no annotation document – the script attempts to follow the “x-devonthink-item” URL, doesn’t find it, and instead of stopping it attempts to access the text of a document that doesn’t exist, and then crashes.
One of the authors above will need to modify this code section so that the script doesn’t abend when it fails to locate a linked document:
if this_URL is not "" then
set this_annotation to plain text of (get record with uuid this_URL)
else
set this_annotation to ""
end if
For you, if you look to find a document that has an “x-devonthink-url” that does not point to an actual linked document, and remove the URL, you should be able to run the script. Be aware you might have more than one case that has a bad URL.