Drafts Action Directory

Blog Post Idea to Things

Posted by raigmcclellan, Last updated: 2018-05-27 15:50:36 UTC - Unlisted

This script will take the content of the current draft, create a Things task with a link to the draft, and tag the draft how you like so you can remember to write the brilliant blog post you just had the idea for.



  • script

    // Blog Post Idea to Things
    const postIdea = draft.content;
    var markdownText = "# " + postIdea
    // Take the content of the current draft, add a Markdown H1, and get link to draft to send to Things
    function setDraft() {
    	draft.content = "# " + postIdea;
    	draft.addTag(""); // Insert Drafts tag between quotations
    	return draft.permalink;
    var draftURL = setDraft();
    // Create task in Things with post title as the task name and the URL to the draft in notes
    var todo = TJSTodo.create();
    todo.title = postIdea;
    todo.notes = draftURL;
    todo.list = ""; // Insert your project name between quotations
    todo.heading = ""; // Insert your heading between quotations
    // Create container to send task to Things
    var container = TJSContainer.create([todo]);
    // Send to Things via Callback URL
    var ncb = CallbackURL.create();
    ncb.baseURL = container.url;
    var success = ncb.open();
    if (success) {
    	console.log("Item added to Things");
    else {
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.