Action

文摘言论集合

Posted by 2818labs, Last update 9 months ago

这个脚本用于在Drafts应用中将当天的多个“文摘言论”草稿合并成一个草稿,并插入当前光标所在的位置。

Steps

  • script

    let drafts = Draft.query("", "inbox");
    let today = new Date();
    today.setHours(0, 0, 0, 0); // 设置时间为当天的零点
    let todayDrafts = drafts.filter(d => d.tags.includes("文摘言论") && d.createdAt >= today);
    let mergedContent = todayDrafts.map(d => d.content).join("\n");
    
    // 插入内容到当前草稿的光标位置
    editor.setSelectedText(mergedContent);
    

Options

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