Action

Quick List

Posted by trontz, Last update almost 5 years ago

Create a Quick List in omnifocus and open to it

Steps

  • script

    /**
     * This is a drafts action designed to create a "quick list" in omnifocus.
     * Each line in the draft will be added to a quick list project.
     * After all of the tasks have been added, the project will be opened in omnifocus.
     */
    
     // split draft into lines
    const lines = draft.content.split("\n");
    const baseURL = "omnifocus://x-callback-url/add";
    
    // loop over lines and send each to OmniFocus QuickList Project
    for (var line of lines) {
    	if (line.length == 0) { continue; }
    	// create and configure callback object
    	var cb = CallbackURL.create();
      cb.baseURL = baseURL;
      cb.addParameter("name", line);
      cb.addParameter("project", "QuickList");
      cb.addParameter("autocomplete", true);
    
    	// open and wait for result
      var success = cb.open();
      if (success) console.log('Added to QuickList!');
    	if (!success) {
    		if (cb.status == "cancel") {
    		   context.cancel();
    		   break;
    		}
    		else {
    			context.fail();
    			break;
    		}
    	}
    }
    
  • url

    template
    omnifocus:///projects/QuickList
    useSafari
    false
    encodeTags
    true

Options

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