Typing a priority by hand is slow and easy to get wrong. A /priority slash command sets urgent, high, medium or low on the task you're on, or removes it.
CONFIG page, or any page you keep code on.space-lua code block (three backticks followed by space-lua) and paste this code inside it:slashCommand.define {
name = "priority",
description = "Set or clear a task's priority",
run = function()
local choice = editor.filterBox("Priority:", {
{name = "urgent", value = "urgent"},
{name = "high", value = "high"},
{name = "medium", value = "medium"},
{name = "low", value = "low"},
{name = "none", value = "none", description = "Remove the priority"}
})
if not choice then return end
local line = editor.getCurrentLine()
local text = string.gsub(line.text, "%s*%[priority:[^%]]*%]", "")
if choice.name ~= "none" then
text = text .. " [priority: " .. choice.name .. "]"
end
editor.replaceRange(line.from, line.to, text)
end
}
System: Reload./priority and pick a level.[priority: high] (or the level you picked) to the end of the line, replacing any priority already there.where t.priority == "urgent".