Action

WalkWriter

Posted by Mudman, Last update almost 4 years ago

I work for a company selling hiking holidays, and have to hike and describe trails before customers are sold a holiday.
During a hike I will need to periodically stop to describe a turn or distinctive feature, and need to capture the time and location of such stops.

This walk writing workflow allows me to record to record date/time, location and comments (dictated) in Drafts, and tags the notes I take.

Steps

  • script

    /*  Create new draft with template text and tag assigned. */
    
    // create the draft
    var d = Draft.create();
    d.languageGrammar = 'MultiMarkdown';
    
    // create template
    const tpl = `## Walk Writing Record [[created|%Y%m%d%H%M%S]]
    **Date:** 			[[created|%A, %d %B %Y]]
    **Time:** 			[[created|%H:%M:%S %z (%Z)]]
    **Location:** 		[[latitude]], [[longitude]]
    **Comments:**	`;
    
    // process the template, add tags and archive the draft
    var x = d.processTemplate(tpl);
    
    // open dictation to insert in current draft
    var s = editor.dictate();
    
    if (s.length > 0) {
    	d.content = x + s;
    	d.addTag("walking");
    	d.addTag("walk-writing");
    	d.isFlagged = false;
    	d.isArchived = true;
    	d.update()
    }
    
    editor.load(d);
    editor.activate(d)
    

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.