Action

Split Cards

Posted by @sylumer, Last update almost 2 years ago - Unlisted

Steps

  • script

    const DELIM = "Q:";
    const TAG = "qacard";
    let astrCards = draft.content.split("\n" + DELIM);
    astrCards.map(strCard =>
    {
    	if (strCard.length > 0)
    	{
    	    let dNew = Draft.create();
    	    if (strCard.startsWith(DELIM)) dNew.content = strCard;
    	    else dNew.content = DELIM + strCard;
    	    dNew.content = dNew.content.replaceAll("\nA:", "\n\nA:");
    	    dNew.addTag(TAG);
    	    dNew.update();
    	}
    });

Options

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