Add to Diary on Dynalist (2 colors)

Posted by sorashima, Last update almost 4 years ago
  1. Set the first line of the draft as the title and the rest as note for the node.
  2. Convert drafts tags to Dynalist tags and add them to note.
  3. If you choose red for the title color, today’s date will also be added to the note as a Dynalist date tag.
  4. Then add it to the Dynalist Inbox.

You need to enter the Dynalist Secret Token the first time you launch this action.

The first time you launch this action, the Dynalist Secret Token registration dialog is displayed.
Enter the token there and it will be saved in “Credetials”.
The token saved in “Credetials” will be used to send data to Dynalist for the next invocation of this action.

To delete the token, tap the “Forget” button in the Dynalist field in Drafts Settings > Credetials.

The original version I made earlier is here.


  • script

    var credential = Credential.create("Secret Token of Dynalist", "Dynalist");
    credential.addPasswordField("token", "Secret Token");
    let tagLine = => '#' + t).join(' ');
    let p = Prompt.create();
    p.title = 'Which style do you use?'
    p.addButton('Red with date-tag', 1);
    p.addButton('Blue without date-tag', 5);
    if (! {
    } else {
      let dlDateLine = (p.buttonPressed == 1) ? `!(${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": p.buttonPressed
      if (response.success) {
        var rText = JSON.parse(response.responseText);
        if (rText._code == 'Ok') {
        } 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.