Agile Business Navigator

A new spin on where business agility can take you

Agile Business Navigator header image 2

The continuing kGTD Saga

March 29th, 2006 · 2 Comments

I like living on the safe side of the bleeding edge for clients and the cutting edge for my own adventures. So, when I spotted that the new version of kGTD (Kinkless) was released - I jumped at it and installed it.

Always backup first, right? Two things stopped working right off the bat. First, I use the Next Actions section to see what I have to do next. Its a nice one-stop-shop for all my actions. Tick everything off as I do it (Sheesh, I've been working with UKers too much - I'm saying tick instead of check). The section is gone and is difficult for the developer to put back. I'll have to live without it for now.

Next - I use a product called Mail Act-On that allows me to setup a special keystroke in a mail rule that does a set of steps on a given email or emails. For instance, I send over emails that have actions attached to them and the actual email gets copied into my kGTD inbox. I used a third party script called mail2kgtd that enabled the process. Worked like a charm until I upgraded. Pressed my keystroke to send over an email and it just makes an error noise. Nothing in my inbox.

I haven't touched AppleScript. I created apple applications back in the stone age of having a little Mac without a hard drive. But there are other scripts out there that I looked at and comparing the two scripts figured out it wasn't able to find my kGTD file. Changed that area in the script and all set.

Here's the original source for the mail2kgtd: CG - Mail2kgtd. And my updated version:

using terms from application "Mail"
on perform mail action with messages allMessages
try
my generateItems(allMessages)
on error theError number theNumber from theOffender
beep
– display alert "Error " & theNumber & " occurred" message theError as critical buttons {"OK"} default button 1 giving up after 15
end try
end perform mail action with messages
end using terms from

on run
tell application "Mail"
if (count of selected messages of message viewer 1) is 0 then
display alert "No messages selected" message "Please select some messages to export or click 'Reset' to set new defaults" buttons {"Reset", "OK"} default button 2 giving up after 15
copy result as list to {theButton}
else
set allMessages to selected messages of message viewer 1
my generateItems(allMessages)
end if
end tell
end run

on generateItems(allMessages)
tell application "Mail"
repeat with i from 1 to number of items in allMessages

set curMessage to item i of allMessages
set curText to reply to of curMessage & ", " & subject of curMessage
set curID to message id of curMessage
set curBody to content of curMessage

set curSubject to subject of curMessage

set curSender to sender of curMessage
set theHeaders to all headers of curMessage

tell application "OmniOutliner Professional"

(* open or identify document *)
set ThisDocumentPath to do shell script "defaults read com.kinkless.kgtd lastpath"

set ThisDocument to (first document whose path is ThisDocumentPath)
try
get ThisDocument
on error
open with results ThisDocumentPath
set ThisDocument to (first document whose path is ThisDocumentPath)
end try

tell ThisDocument
set InboxSection to (first row whose note contains "meta_inbox")
set TheTopic to curSender & ": " & curSubject
set TheNote to curBody & " " & curID
make new row at end of rows of InboxSection with properties {topic:TheTopic, note:TheNote}
end tell
end tell

end repeat
end tell
end generateItems

Tags: kGTD

2 responses so far ↓

  • 1 andrea // May 7, 2006 at 3:02 am

    Hi, I’m trying to adopt your script in my flow, but something does not work…

    I copy and paste your script into script editor, i try save it into ~/Library/Scripts/Mail Scripts/, but it does not save as script: “Expected expression but found command name” and “– display alert ” is highlited…

    OO 3.6 final, Kgtd .83, 10.4.6 pbook g4

    I’m stuck, looked in kgtd forum, but it did not help…

  • 2 Gavin // Sep 4, 2006 at 3:36 pm

    Thanks for your updated script! I am completely ignorant of applescript, and not inclined to learn at this time. Your edited version helped my mail2kGTD get working. Much appreciated.

Leave a Comment

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image