Action

Selectandcut

Posted by jbwhaley, Last update over 4 years ago

Selects the current line and cuts it to the clipboard. Best used in a custom keyboard.

Steps

  • script

    // Grab current line and send to the system clipboard
    var range = editor.getSelectedLineRange();
    editor.setSelectedRange(range[0],range[1]-1);
    var clip = editor.getSelectedText();
    app.setClipboard(clip);
    
    // Remove current line from draft
    editor.setSelectedRange(range[0],range[1]);
    var cut = editor.getSelectedText();
    editor.setSelectedText('');
    
    // Set cursor position to end of previous line
    editor.setSelectedRange(range[0]-1);

Options

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