Quick add to Dynalist inbox using AutoHotKey


#1

Using AutoHotKey (Windows) I’ve created a keyboard shortcut that lets me easily add an item to my inbox without having to open up Dynalist.

Typing Ctrl-Win-F pops up this little input:

image

Here’s the script:

^#f::AddToDynalist()  ;  ctrl-win-F

AddToDynalist() {
	DynalistToken := "~~ YOUR API KEY HERE ~~"
	InputBox, UserInput, Task,Add to Dynalist inbox:,,350,125 
	If (!ErrorLevel and UserInput <> "")
	{
		; UserInput := UriEncode(UserInput)
		URL := "https://dynalist.io/api/v1/inbox/add"
		HttpObj := ComObjCreate("WinHttp.WinHttpRequest.5.1")
		HttpObj.Open("POST", URL, 0)
		HttpObj.SetRequestHeader("Content-Type", "application/json")
		Body := "{ ""token"": """ . DynalistToken . """, ""index"": 0, ""content"": """ . UserInput . """, ""checked"": false }"
		HttpObj.Send(Body)
		Result := HttpObj.ResponseText
		Status := HttpObj.Status
	}
}
 

#2

What do you mean? Why would you close Dynalist? :joy:

Useful script. Thanks for posting. :+1:


#3

Works great. :slightly_smiling_face:

One small thing though, I have my Inbox set to add new items to the bottom of the list - the script adds them to the top. Is that the API call?


#4

That’s what the index parameter is in the API call - just set it to -1 to force to the bottom, or remove it altogether to use your default.
https://apidocs.dynalist.io/#send-to-inbox


#5

Excellent! Thanks.