Action

Split Lines to New Drafts

Posted by sylumer, Last update over 3 years ago - Unlisted

Splits a line to new Drafts.

A new draft is created for every non-blank line, with that line as its content.

Steps

  • script

    let intCounter = 0;
    draft.content.split("\n").forEach(function(strLine)
    {
    	if (strLine.trim().length > 0 )
    	{
    		let draftNew = new Draft;
    		draftNew.content = strLine;
    		draftNew.update();
    		intCounter++;
    	}
    });
    app.displayInfoMessage(`${intCounter} drafts created.`);

Options

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