Action

Hoist line to top

Posted by derick, Last update over 6 years ago

Move current line to the top of the document

Steps

  • script

    // See online documentation for examples
    // http://getdrafts.com/scripting
    
    // adapted from http://1writerapp.com/action/3b53d
    
    range = editor.getSelectedLineRange();
    line = editor.getTextInRange(range[0], range[1]);
    
    if (range[0] > 0) {
    	editor.setTextInRange(range[0] - 1, range[1], "");
    	editor.setTextInRange(0, 0, line);
    }

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.