Capture Tasks and Ideas in Evernote

Description

I’ve created this AppleScript which I can launch with a keyboard shortcut which creates a “running list” of these unexpected bits of inspiration before I lose them– an “Idea Scroll”, if you will. When I get an idea, I hit the special keystroke combination and the script asks me a few quick questions. In my case, I usually like to be able to say what the idea is, what it’s for, and add a few additional details. After I answer these quick questions, it’s added in the background to a special note in Evernote. When it’s time to review my ideas and put them into my project or to-do list, I just read down my list. Simple! If I’m collaborating with someone, Evernote’s built-in Email client makes it easy to send my brainstorms off to the people I’m working with. I left in the Veritrope.com graphic in the template to demonstrate how you can use base64 encoding to inject graphic elements directly into any templates you design. I've also left in a bit of code to tag these items -- it's currently commented out, but you can turn it back on with a quick edit! A full explanation with screenshots and a download is available on this page.

The Code

(*
http://veritrope.com
Idea Scroll
Version 1.0
August 26, 2010
Project Status, Latest Updates, and Comments Collected at:
http://veritrope.com/tips/idea-scroll
*)


property the_Issue : ""
property the_Command : ""
property the_Details : ""
property the_Timestamp : ""
--SET THE ICON
tell application "Finder"
    set app_alias to application file id "com.evernote.Evernote" as alias
end tell
set icon_file to path to resource "Evernote.icns" in bundle app_alias

--GET THE REPORT
display dialog "What's Your Idea?" default answer "" with title "Idea Capture" with icon icon_file
set the_Issue to text returned of result

display dialog "Who or What Is It For?" default answer "" with title "Idea Capture" with icon icon_file
set the_Command to text returned of result

display dialog "Describe It In More Detail..." default answer ¬
    "

    "
with title "Idea Capture" with icon icon_file
set the_Details to text returned of result

--SET UP SOME VALUES
set the_date to (short date string of (current date))
set the_Timestamp to "" & the_date & ", " & (time string of (current date))

--SET THE TEMPLATES
set new_Template to "
<a href="
http://veritrope.com"><img align="right" alt="Veritrope" src="" /></a>
<br /><h1>Idea Scroll</h1>
<h2>"
& the_date & "</h2>
<br /><br /><br />
<table border="
1" width="100%" cellspacing="0" cellpadding="2">
<tbody>
<tr BGCOLOR="
#d4d4d4">
<td valign="
top" ><strong>Idea Name: </strong>" & the_Issue & "</td>
<td valign="
top"><strong>Date / Time: </strong>" & the_Timestamp & "</td>
</tr>
<tr BGCOLOR="
#d4d4d4">
<td valign="
top"><strong>Who/What For It's For:  </strong> " & the_Command & "</td>
<td valign="
top"><strong>Act On This?:</strong> <input type="checkbox" class="en-todo" onclick="javascript:window.noteEditor.todoClicked()" /> </td>
</td>
</tr>
</tbody>
</table>
<table border="
1" width="100%" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="
top">Details:<br/>
<br/>"
& the_Details & "</td>
</tr>
</tbody>
</table>
<hr />
<br /><br />
"


set add_Template to "
<br/>
<table border="
1" width="100%" cellspacing="0" cellpadding="2">
<tbody>
<tr BGCOLOR="
#d4d4d4">
<td valign="
top"><strong>Idea Name: </strong>" & the_Issue & "</td>
<td valign="
top"><strong>Date / Time:  </strong>" & the_Timestamp & "</td>
</tr>
<tr BGCOLOR="
#d4d4d4">
<td valign="
top"><strong>Who/What For It's For:  </strong> " & the_Command & "</td>
<td valign="
top"><strong>Act On This?:</strong> <input type="checkbox" class="en-todo" onclick="javascript:window.noteEditor.todoClicked()" /></td>
</tr>
</tbody>
</table>
<table border="
1" width="100%" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="
top">Details:<br/>
<br/>"
& the_Details & "</td>
</tr>
</tbody>
</table>
<hr />
<br /><br />
"


tell application "Evernote"
    --LOOK FOR EXISTING IDEA ROLL
    set search_query to "intitle:"Idea Scroll for " & the_date & """
    set foundNotes to find notes search_query
    --IS IT THERE?
    set found to ((length of foundNotes) is not 0)
    --YES!
    if found then
        --"NOTE 1" IS ORIGINAL NOTE
        set note_1 to find notes search_query
       
        --"NOTE 2" IS ADDED NOTE
        set note_2 to (create note title "Note 1" with html add_Template)
        set HTML_note_2 to HTML content of (item 1 of note_2)
       
        --"MERGE" THE TWO TOGETHER...
        append (item 1 of note_1) html HTML_note_2
       
        --DELETE OLD NOTE
        delete note_2
       
        --NO!
    else
        --set tag1 to "Tag 1"
        --set tag2 to "Tag 2"
        --set tag3 to "Tag 3"
       
        set note_new to create note with html new_Template ¬
            title "Idea Scroll for " & the_date & ""
        --assign tag1 to note_new
        --assign tag2 to note_new
        --assign tag3 to note_new
    end if
end tell

2 Responses to “Capture Tasks and Ideas in Evernote”

  1. Janie April 9, 2011 at 4:34 am #

    Justin,

    If I wanted to set this up so that IDEA SCROLL was not daily but an ongoing file, until I rename it and create another, would I do the following?

    (1) Remove this line:

     " & the_date & "

    (2) Change this:

    set search_query to "intitle:"Idea Scroll for " & the_date & """

    To:

    set search_query to "intitle:"Idea Scroll"

    (3) Change this:

    set note_new to create note with html new_Template ¬
                title "Idea Scroll for " & the_date & ""

    To:

    set note_new to create note with html new_Template ¬
                title "Idea Scroll"

    ==================

    If I want to have the new dated notes always go to the top of the file, the opposite of how you have it now, would I reverse the code for Original Note and Added Note, and change the numbering? I’m unclear about what these terms (Original and Added) mean from your perspective. Since you delete note_2, and call it “Old Note” in the comments, I’m assuming it was, what, the last entered?

    I guess what is confusing me about AppleScript is how a couple of instructions in a section like this can accommodate handling multiple entries, for the day in this case, with a ‘merge’.

    Hope I’m making myself clear.

    I think you’re a doll to provide these scripts, and urge our playing around with them.

    If I wanted the new dated notes to go at the top,

  2. Janie April 9, 2011 at 4:41 am #

    Oops, (1) above didn’t print properly. I’ll try this:

    <h2>" & the_date & "</h2>