Add to Diary on Dynalist

Posted by sorashima, Last update about 4 years ago

Set the first line as the title and the rest as a note. Convert drafts tags to Dynalist tags and add them to note. Today’s date is also added to the note as a Dynalist date tag. Then add it to the Dynalist Inbox.

need Dynalist secret token.

When this action is executed for the first time, the token registration screen is displayed. In the second and subsequent executions, the token registered for the first time is read.
To delete the token, tap the “Forget” button of Dynalist in Credentials on Drafts setting screen.


Changed the behavior to keep draft in the inbox when an error occurs due to a problem with the Dynalist server.


Improved handling of communication error between Drafts and Dynalist server.


  • script

    var credential = Credential.create("Secret Token of Dynalist", "Dynalist");
    credential.addPasswordField("token", "Secret Token");
    let tagLine = => '#' + t).join(' ');
    let dlDateLine = '!(' + strftime(new Date(), '%F') + ')';
    var http = HTTP.create();
    var response = http.request({
      "url": "",
      "encoding": "json",
      "method": "POST",
      "data": {
        "token": credential.getValue("token"),
        "index": "-1",
        "content": draft.processTemplate('[[title]]'),
        "note": draft.processTemplate('[[body]]') + '\n\n' + tagLine + '\n' + dlDateLine,
        "color": "1"
    if (response.success) {
      var rText = JSON.parse(response.responseText);
      if (rText._code == 'Ok') {
    //    alert(rText._code);
    //    app.displaySuccessMessage(`Posted to Dynalist successfully.`);
    //    alert(;   
    //    app.setClipboard(rText.node_id);
      } else {
        alert(rText._code + '\n' + rText._msg);
    } else {
      alert(response.statusCode + '\n' + response.error);


  • After Success Archive , Tags: diary
    Notification Error
    Log Level Error
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.