Drafts Action Directory

✪ #-

Posted by Mirko, Last update 5 months ago

This action can decrease heading level just like Ulysses

Install

Steps

  • script

    var allLine = editor.getSelectedLineRange();
    var allText = editor.getTextInRange(allLine[0],allLine[1]);
    
    var con = allText.split(" ",);
    var arr = con[0];
    var ver = 0;
    
    for(var i=0;i<arr.length;i++){
        if(arr[i]=="#"){
        ver++;}
    };
    
        if(ver==arr.length && con.length>1 && arr.length>0){
        var newText = allText.substr(1,);
        editor.setTextInRange(allLine[0],allLine[1],newText);
    }

Options

  • After Success Nothing
    Notification Error
    Log Level Error

Comments

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