Action

Smart Copy

Posted by pseudometa, Last update almost 3 years ago

Copy selected text like normal cmd + c. If no text is selected, will copy the current line instead (similar to the behavior in code editors).

Steps

  • script

    text = editor.getSelectedText();
    
    if (!text) {
    	const [st, len] = editor.getSelectedLineRange();
    	text = editor.getTextInRange(st, len);
    }
    
    app.setClipboard(text);
    

Options

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