Drafts Action Directory

Add Current Line to Clipboard

Posted by @singleitemstore, Last update 5 months ago

Copies the current line to the clipboard without having to select text.

Install

Steps

  • script

    // Select Current Line
    
    var lineRange = editor.getSelectedLineRange();
    var eol = lineRange[0] + lineRange[1];
    
    if ( editor.getTextInRange( eol - 1, 1 ) === '\n' ) {
      eol = eol - 1;
    }
    
    line = editor.getTextInRange( lineRange[0], eol - lineRange[0] );
    
    app.setClipboard(line);
    

Options

  • After Success Default
    Notification Info
    Log Level None

Comments

Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.