Is it possible to use Smart Rules to manage tags?

I’ve recently sophisticated my tagging system for documents, treating them as a workaround to getting fiddly with replicas and folder structures. As part of this, I’ve started tagging documents associated with a particular author (either written by or about them) with a tag that names its author, i.e. “harvey, david” is the tag I give to all documents associated with the geographer David Harvey.

I use tags for other things as well, though, like associating documents that have the same theme (“ghosts”, “capitalism”, etc). To keep my tags listings clear, I’ve introduced one level of hierarchy, wherein all of the author tags above are kept under a parent tag called ‘author’, and all of the thematic tags are kept under a parent tag called ‘theme’. This means that I can easily open up the ‘theme’ tag and see all of the current themes I’m using to associate documents before deciding to create a new one. This is what my outer layer of tags for my database looks like:

The problem this introduces is that every time I create a new author tag, it is created in the outer layer of the tag hierarchy, not as a subtag of ‘author’. This means that I periodically have to go and ‘clean up’ the tag hierarchy, moving all the tags with the structure “lastname, firstname” underneath the ‘author’ tag.

I am wondering what the best way to automate this is. I tried to create a Smart Rule to do so on the creation of every tag, but the interface doesn’t seem to allow me to use any operators other than “is” or “is not” with respect to tags, and moreover I’m a bit confused about how I would move the tag in the tag hierarchy via the Smart Rule in any case.

Another solution I have thought about is running a script periodically (through a Smart Rule) which somehow manages the restructuring; but this doesn’t seem as clean a solution, and I’m not totally sure what the relevant API calls would be in applescripts.

Any suggestions would be much appreciated!

Is is possible to distinguish tags which should be filed in e.g. author from those filed in place, project, theme etc.?

I’m not 100% on what you mean sorry. The author tags are completely unrelated to the other tags, in the sense that a document might have the following tags: ‘author’->‘harvey, david’, ‘theme’->‘capitalism’, ‘place’->‘new zealand’, to indicate that the text is authored by David Harvey, is thematically related to capitalism, and was read in New Zealand.

The automation I am trying to create is: if the newly created tag has a comma in it (or better; “is two words with a comma between”), make it a subtag of ‘author’.

The automatic creation of tags (e.g. via the Info inspector or Tags bar) does not yet trigger smart rules but this will be supported by the next release. Then you should be able to use a smart rule like this (just tested this successfully):

1 Like

Fantastic! Thanks.