Add to Sorted (Bulk)

Posted by kjaymiller, Last update over 5 years ago

Designed for adding multiple tasks in one go, the Bulk Sorted Add loads all items in a list.

If the title starts with “#”, the title will be set as a list.


  • script

    // See online documentation for examples
    var project = draft.processTemplate('[[Line|1]]');
    let baseURL = 'sorted://x-callback-url/add/'
    let reTasks = /(- (\[ \] ){0,1})(.+)/g
    // TODO: Add Logic for - [ ]
    // TODO: Group expression to filter out - ([ ])
    tasks = []
    while ((match = reTasks.exec(draft.content)) != null) {
     var url = CallbackURL.create();
        url.baseURL = baseURL;
        url.addParameter('title', match[3]);
        if (project.startsWith('#'))
        url.addParameter('list', project.substring(2))
        var success =;


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