Summary
Scripting is super powerful in combination with something like Keyboard Maestro or any app where you can assign a keyboard shortcut to run some scripts.
This thread will list out some of the things I’m doing, and I’ll post shortly my scripts and keyboard maestro group for those that are interested edit: added. Some things are specific to how I like to work, but they should give you a glimpse into what’s possible today with some small scripting.
My macros:
Bike Macros.kmmacros.zip (131.2 KB)
Edit two: I’m going to try converting my KM file into a Bunch file as it’s a great free app that would be easy for people of this community to install without needing to pay for KM.
Toggle States
Toggle the current line between some set prefixes. I’ve got mine set to 'TODO', 'DOING', 'DONE'
Gif Example
Script
(() => {
var bike = Application('Bike')
var app = Application.currentApplication()
app.includeStandardAdditions = true
var kmInst = app.systemAttribute('KMINSTANCE')
var kmeApp = Application('Keyboard Maestro Engine')
const main = () => {
var doc = bike.documents[0]
var selectedRow = doc.selectionRow()
if (!selectedRow) return false
var states = ['TODO', 'DOING', 'DONE']
var rowContent = selectedRow.name()
if (new RegExp(`^(${states.join('|')})`).test(rowContent)) {
selectedRow.name = rowContent.replace(new RegExp(`^(${states.join('|')}) *(.*)`), function (_, s, r) {
var index = states.indexOf(s)
var state = states[index+1]
if (state) {
state += ' '
} else {
state = ''
}
return `${state}${r}`
})
} else {
selectedRow.name = `${states[0]} ${rowContent}`
}
}
return main()
})()