Automating collection of To Dos from meeting notes using DevonThink, AppleScript and Things

For sometimes now, I went fully digital when attending meetings (one on one, research, scientific congress or even committee meetings). I adopted the iPad for that task just a few month after it came out on the market. There are multiple choices of apps out there for note taking. Apple Notes actually is probably the most simple, and quite efficient, one. Since I bring all of my meeting documents with me in DevonThink To Go or DTTG (see my e-office series to see how I make this work), I now take almost all of my meeting notes directly in DTTG. DTTG sync with DevonThink Pro Office (DTPO) edition on my Mac. I am looking forward for the new sync features of DTTG 2.0 but for now this works really fine.

The point is, I am throwing all my documents in DevonThink, including these meeting notes. So in practice for what follows, it does not matter which note taking tools you are using. Also one of the great feature of the Pro and the Pro Office editions is that they are fully scriptable.

TaskCollector

 

 

The following script (end of this post), that I call TaskCollector, will skim through your meeting notes file and extract all the To Dos (action items, tasks or whatever name you are using for these!) and create an individual entry for each in Things Inbox, with a link back to the notes (your context!) in DevonThink.

Instructions:

  • Copy and paste the text below into a text file (add the extension .scpt)  or AppleScript Editor and save the file.
  • I use the keyword “ACTION:” because this is what I use in my notes. You can change this for anything you want (Task, ToDo, …) by changing the assignment to “textDelim”. One stop!
  • DO not worry if the formatting of the text below looks bad. It was lost when pasting from the AppleScript file. If you copy in and save it with the AppleScript Editor it will re-indent itself!
  • Copy the file to : your library -> Application Support -> DevonThink Pro -> Scripts folder and pick an appropriate subfolder. I used the Data one.
  • Your can assign a hot key by adding, e.g.,  ___Cmd-F15 (3 underscores) at the end of the file name: TaskCollector___Cmd-F15 .
  • In DevonThink (Pro or Office edition), the script will now be available via the Application Script menu (or hot key if you assigned one).

 

Disclaimer:

I am not a professional AppleScript person. So this is provided as is. As of March 7 2015, it works on my system (DTPO v2.8.3, Things 2.5.3 and OSX 10.10.2)

 

The Script:  – please give credits and copy the header 😉

 

— Script to automatically scan a text file within DevonThink Pro or DevonThink Pro Office, extract task items and send them to Things

— Written by Luc Beaulieu, Version 1.0, March 7, 2015

— Re-use portions of a script “Add as To Do to Things” written by Eric Böhnisch-Volkmann, Version 1.0.1, Jan 28, 2010

— Set properties

property pTags : “DEVONthink”

try

 

— Get the selection

tell application id “com.devon-technologies.thinkpro2” to set thisSelection to the selection

 

— Error handling

if thisSelection is {} then error localized string “Please select a document, then try again.”

if (length of thisSelection) > 1 then error localized string “Please select only one document, then try again.”

 

— Get and format the data we need

set pLocalizedTags to localized string of pTags

tell application id “com.devon-technologies.thinkpro2”

set theSource to content record

set theText to plain text of theSource

set theLines to paragraphs of theText

set thisItem to first item of thisSelection

set theSummary to (name of thisItem) as string

set theURL to (“[url=x-devonthink-item://” & uuid of thisItem & “]” & name of thisItem & “[/url]”) as string

end tell

 

— Iterating through each line, one by one, for the string delimeter “ACTION:”

— and create a new task in Things global Inbox if appropriate

set textDelim to “ACTION:”

set nTask to 0

repeat with eachLine in theLines

set nextLine to eachLine

set finalTask to “”

if nextLine contains textDelim then

set AppleScript’s text item delimiters to textDelim

set theTask to item 2 of every text item of nextLine

set AppleScript’s text item delimiters to “”

set finalTask to finalTask & theTask

— set finalTask to finalTask & theTask & return

end if

if finalTask is not equal to “” then

set nTask to nTask + 1

tell application “Things”

— create task entry in Inbox with a link back to the meeting notes

make new to do with properties {name:finalTask, notes:theURL, tag names:pLocalizedTags}

end tell

end if

end repeat

 

display dialog (nTask as string) & ” were created!”

on error errMsg

display alert (localized string “Error extracting task”) message errMsg

 

end try

Posted on March 7, 2015, in How To, Software, Technology and tagged , , , , , , , , , , . Bookmark the permalink. 2 Comments.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: