Devonthink has labels (the coloured marker you can apply to files) but it it only allows one set of labels for all of your databases. Setting the label names also requires a trip to preferences, something you are unlikely to do every time you want to label a file.
The result is that coloured labels rapidly become a mess as you try to apply one set of labels across all your databases
This script allows you to:
Have custom labels for each database
Apply the custom labels to the selected documents
Edit the label names at the same time you apply the labels.
The result is that labels can be applied much more consistently.
Any changes you make to the label names in the Custom Label will be persistent and will appear the next time a label is applied. The custom label names will also appear in the label drop down box in the Document Review pane and Annotation pane scripts.
To make this work effectively edit your default labels in Devonthink preferences to the following
When you apply and edit the label names keep the colour as the first word of the label name. That way your labels will still be easily identifiable when creating smart groups or in advanced searches.
If you want to know more about how this script works and the config.scpt file it places in the Inbox/annotations/configurations directory of the database you should read the Annotation Pane thread.
NB If you are intending to use this as a standalone script, you Will have to run the Annotation pane script at least once per database to set up the configuration files or you will get an error. This will be fixed in the next version
Although you can highlight more than one checkbox only the first checked label will be applied.
Just to say “Thank you” to Frederiko for this script and all the others that he produces; I have tried to get my head round writing scripts on a number of occasions and just do not seem to have the logical brain for it, so I am truly grateful to all the folk who generously spend their time and energies on writing these wonderful scripts for everyone’s benefit. I raise a glass to you.
They are all scripts that come up in my workflow so its not a problem to publish them. Pleased they are helpful.
DT is almost the best place to learn applescript . The object model is superbly well done with very few inconsistencies and great help. Its very self contained and “clean” which is not something that can be said about applescript in general. Huge kudos and thank you to Devonthink’s brilliant developers for all the time that must have gone into the applescript support. Its a part of DT most people will never see, but those who do really will appreciate its elegance and the thought that has gone into making it so useful.
The only comparable apps with the same level of elegance to their dictionaries seems to be the Omni group’s. Apple’s own apps mostly fall some way behind. Textedit is fine and Numbers and Pages are ok and why Preview doesn’t have applescript support is just stupid.
Looking at the very good scripts that ship with DT is the best place to start. The scripts are so comprehensive invariably you will find a script there that already does most of what you need and only requires tweaking. If you can’t find it there then these forums will probably have a script that’s close (and korm will almost certainly have written it!). The basics of applescript are very well covered in Learn AppleScript The Comprehensive Guide to Scripting and Automation on Mac OS X (as are much more advanced stuff). Its pretty much essential.
Thank you I’ve probably written hundreds of scripts for DEVONthink and DEVONagent and use several of them on my own each day. By the way, a future release will improve the integration and automation with AppleScript a lot.
And as the plugin API and the AppleScript dictionary are based on the same layer, we’re even considering to publish the API some day (the API is currently revised) so that third-party developers could write plugins for DEVONthink. Especially as plugins have two major advantages (higher performance and fully integrated into the user interface).
Excellent script! I’m sure there are lots of useful applications. I’m baffled, however, why a single set of clearly defined labels across all databases would “quickly become a mess”? It’s the opposite: Clear rules, easy to remember. That’s the original idea behind labels, I suspect: A very limited set, therefore “global” and rememberable, and not to be misunderstood. So there is no “Here is a red label, OK…, what DB am I in right now?” confusion.
Any characterization on a finer level I’d do with groups in the respective DB.
That’s my view, but I’m sure this depends a lot on the particular workflow.
It wasn’t meant as a criticism of DT at all. I suspect that the way you see labels is the way most people do.
My work is about finding patterns in a mass of facts, documents and evidence that may not be immediately apparent. I have about 15-20 databases active at any one time which are all completely unrelated. I have found it impossible to come up with one set of labels which satisfies everything I might want to do across all of them.
Often when working with documents, I appreciate that some aspect of them is ideal for the visual portrayal that coloured labels offer. I find it very convenient to pull up the custom label script, select an unused colour and then label it with something appropriate for the task at hand. In all likelihood this is not a relationship I will want to express in another database.
In one database I may colour different document sets with different labels so when I merge them in a smart group I have a visual representation of how the documents cluster together in time. In another database I may want to highlight different events in a chronology. In a lengthy series of chronological documents I will sometimes highlight all the documents that have a particular tag, such as that identifying a particular person so that those documents or annotations stand out. These labels may be ephemeral and having used used them once or twice I may reuse the labels at some later stage for something different in the same database. For these use cases being able to easily relabel the document to express its precise purpose is important.
Labels are also important in my use of Aeontimeline and I like the flexibility of being able to rename them before I send labelled documents off to Aeon.
I also wanted my label names to to appear in the Document Review Pane and Annotation Pane as well as other scripts I use all the time. Label names are not accessible from applescript so to make them easily editable flowed from there.
Impressive! I can definitely see the use of different label assignments there. Personally, I’d still struggle with keeping track of what means what if they are open simultaneously, but that’s probably a matter of routine, or the way we’re wired. I became a subatomic physicist to avoid complexity. Molecular spectra already scare the heck out of me