Here’s the plug-in for displaying the child tags in the Kanban tag set, which will be created if needed. UPDATE: Thanks to @draft8 for the wisdom. I’ve added code for creating child tags if needed, and reordering them if needed.
/*{
"type": "action",
"targets": ["omnifocus"],
"author": "Otto Automator",
"identifier": "com.omni-automation.of.display-kanban-tags",
"version": "1.0",
"description": "Plug-in will select all of the child tags of the “Kanban” tag set, which will be created if needed.",
"label": "Display Kanban Tags",
"shortLabel": "Kanban"
}*/
(() => {
var action = new PlugIn.Action(function(selection, sender){
// IDENTIFY KANBAN TAG, CREATE IF MISSING
var targetTag = flattenedTags.byName("Kanban") || new Tag("Kanban")
// ADD KANBAN CATEGORIES IF MISSING
var tagTitles = ["To Do", "In Progress", "Waiting", "Done"]
tagTitles.forEach(title => {
if (!targetTag.children.byName(title)){
new Tag(title, targetTag)
}
})
// REORDER THE CATEGORIES
tagTitles.forEach(title => {
var tag = targetTag.children.byName(title)
moveTags([tag], targetTag)
})
// SHOW THE TAGS
var tagIDs = targetTag.children.map(tag => tag.id.primaryKey)
var tagIDsString = tagIDs.join(",")
URL.fromString("omnifocus:///tag/" + tagIDsString).open()
});
return action;
})();