Simple spoon that creates a new task in Asana with a given name in a given workspace.
Example configuration (using SpoonInstall.spoon and Seal.spoon):
-- Load configuration constants used throughout the code
consts = require "configConsts" -- just a table
-- Load Asana spoon and configure it with API key
spoon.SpoonInstall:andUse("Asana", { config = { apiKey = consts.asanaApiKey } })
-- Load Seal and setup user actions to add task to Asana workspaces
spoon.SpoonInstall:andUse(
"Seal",
{
fn = function(x)
x:loadPlugins({"apps", "calc", "useractions", "rot13"})
x.plugins.useractions.actions = {
["New Asana task in " .. consts.asanaWorkWorkspaceName] = {
fn = function(y) spoon.Asana:createTask(y, consts.asanaWorkWorkspaceName) end,
keyword = "awork"
},
["New Asana task in " .. consts.asanaPersonalWorkspaceName] = {
fn = function(y) spoon.Asana:createTask(y, consts.asanaPersonalWorkspaceName) end,
keyword = "ahome"
}
}
x:refreshAllCommands()
end,
start = true,
hotkeys = { toggle = { "cmd", "space" } }
}
)
With this setup, adding a new task to Asana is as easy pressing Command + Space
to launch Seal and entering, e.g., "awork Do that thing I forgot to do".
Signature | Asana.apiKey (String) |
---|---|
Type | Variable |
Description | A "personal access token" for Asana. You can create one here: https://app.asana.com/0/developer-console |
Source | Source/Asana.spoon/init.lua line 93 |
Signature | Asana:createTask(taskName, workspaceName) -> Self |
---|---|
Type | Method |
Description | Creates a new task named |
Parameters |
|
Returns |
|
Examples | |
Source | Source/Asana.spoon/init.lua line 98 |