I love DEVONThink and find it to be a high quality product.
Thank you for all your great work!
I have one feature that would make DEVONThink even more powerful – Custom properties and the ability to search them!
My Method
I have implemented my own method for custom properties as follows:
I am storing custom properties as JSON in the comments field. I can run scripts that read and write the entire comments field as JSON data using JSON applescript library found at https://itunes.apple.com/ca/app/json-helper-for-applescript/id453114608?mt=12&ign-mpt=uo%3D4.
Sorting
I implement sorting by requiring the first property of the JSON a fixed key like { “_OrderBy” : “2017-02-01” }. This allows me to sort the files by the Comments field so I can place whatever string I want as the value for “_OrderBy” and the files will be sorted according to that value. This is great if you have multiple date values for files like “ScannedDate”, “ProcessedDate”, etc… A script can be run to set the “_OrderBy” value to one of those other dates.
Searching
I implement searches at a two step process. First I execute a find script over a set of files or the entire database and read their custom properties. If they match my sought criteria, I append or update a custom property to be true, ie { “Criteria123” : “true” }. Second, I create a smart folder with the criteria of Comment matches the exact string of that custom property, ie { “Criteria123” : “true” }.
Links to attachments and other related groups or files
If a file has associated attached files, I store the attachments in a subgroup contained under the same group as the file. I store the links to the attachment group or files in a custom property
ie {“Group_Atch_URL” = “x-devonthink-item://9F75548D-327D-48BA-B3F0-15D662CBD548”}. I execute a script to navigate to the associated files or groups. The limitation here is that there must be a script for each custom property name that contains a link and there can be only 1 link for each name. Example
{
“Group_Atch_URL” = “x-devonthink-item://9F75548D-327D-48BA-B3F0-15D662CBD548”
“Group_Assoc_URL” = “x-devonthink-item://9F75548D-327D-48BA-B3F0-15D662C4256123”
“File_ContainedBy_URL” = “x-devonthink-item://9F75548D-327D-48BA-B3F0-15D6642352341”
}
Because a script needs to know which property contains the link, each property requires its own script. Therefore if a document has multiple attachments you need to link to a group.
Exporting
When a database or folder is exported the custom data will appear in the comments of the exported files.
My Request
Plugins
Is there any way for me to develop a Plugin to show custom properties like the Info window?
JSONPath
Can the smart folder criteria be enhanced to include JSONPath criteria?
See https://github.com/jayway/JsonPath.
Example, if file1 had comment of JSON data of
{
“Author” : “Anne Hill”
“Contributor” : [“John Doe”, “Frank Smith”]
“PrintedDate” : “2016-01-30”
}
A JSONPath of $.file.Contributor[2] = “Frank Smith” would find matches where the second contributor was “Frank Smith”.
Thank you,
-Mark