Action

Line to Reminders Inbox

Posted by @nahumck, Last update 7 months ago

UPDATES

7 months ago

  • Sharing publicly
  • Added a warning for a blank line or draft in the script step.
show all updates...

7 months ago

  • Sharing publicly
  • Added a warning for a blank line or draft in the script step.

over 1 year ago

Changed the script object to be more universal. Added an action step for Reminders.

Sends a line to the Reminders Inbox for processing.

Steps

  • script

    /*--- Send a single line to the Inbox of Reminders ---*/
    
    /*--- Get entire line of cursor function ---*/
    function getCursorLine(editor) {
    	var cursorPosition = editor.getSelectedRange()[0];
    	var selectionLength = editor.getSelectedRange()[1];
    	var lineRange = editor.getSelectedLineRange();
    	var sel = editor.getTextInRange(lineRange[0], lineRange[1]);
    	return sel.replace(/^[-\*\s\[\]\|\d\.\{\}]+/gi,"")
    }
    let task = getCursorLine(editor);
    if (task.length == 0) {
    	context.cancel();
    	app.displayWarningMessage("Line is empty");
    }
    else { 
    	draft.setTemplateTag("task",task);
    }
  • reminder

    listNameTemplate
    Inbox
    titleTemplate
    [[task]]
    noteTemplate

Options

  • After Success Default
    Notification Info
    Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.