Explode Draft

Last update 5 months ago - Unlisted

Steps

  • script

    let strTag = promptForTag();
    let astrLines = draft.content.split("\n");
    astrLines.map(processLine);
    
    function processLine(p_strText)
    {
    	let draftNew = Draft.create();
    	draftNew.content = p_strText;
    	if (strTag.length > 0) draftNew.addTag(strTag);
    	draftNew.update();
    }
    
    function promptForTag()
    {
    	const buttonOK = "OK";
    	let promptText = Prompt.create();
    	promptText.title = "Enter Tag";
    	promptText.addTextField("textFieldName", "Tags", "",
    	{
    		"wantsFocus": true
    	});
    	promptText.addButton(buttonOK);
    
    	if (promptText.show())
    	{
    		if (promptText.buttonPressed == buttonOK)
    		{
    			return promptText.fieldValues["textFieldName"];
    		}
    	}
    	return "";
    }

Options

  • After Success Default
    Notification Info
    Log Level Info
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.