emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] processing pending emails as part of your GTD system


From: Christopher League
Subject: Re: [Orgmode] processing pending emails as part of your GTD system
Date: Tue, 22 Apr 2008 12:55:55 -0400

On Apr 21, 2008, at 2:55 AM, Pete Phillips wrote:
One thing I have done is design a method so that I can easily put emails into a set of 'pending' mail folders, and then get cron to process these
and dump the emails back into my +inbox at appropriate dates.

Interesting, I have a similar script that also requires cron/shell access to mail server, but works with mbox format instead of MH, and is compatible with, e.g., dovecot IMAP server. Mine is slightly less fancy, in that I file messages to absolute folders named "days/25" or "months/07-July" (rather than "nextweek") to have them dumped back into my spool at the indicated time. See the 'email-tickler-update' script attached.


More relevant to org-mode, I have an emacs-lisp/apple-script combo for pasting links to Apple Mail messages into org files:

(defun cal-grab-mail-links ()
  (interactive)
  (call-process "/usr/bin/osascript" nil t nil
"/home/league/Library/Scripts/Applications/Mail/Copy Message for OrgMode.scpt")
  (yank))
(define-key org-mode-map "\C-cm" 'cal-grab-mail-links)

;;;;; and the .scpt component:

-- Replace all occurences of one string for another in a text
-- The trick here is to change the internal delimiter,
-- spliting and joining the text
--
on replaceString(theText, oldString, newString)
        set AppleScript's text item delimiters to oldString
        set tempList to every text item of theText
        set AppleScript's text item delimiters to newString
        set theText to the tempList as string
        set AppleScript's text item delimiters to ""
        return theText
end replaceString

tell application "Mail"
        set _sel to get selection
        set _links to {}
        repeat with _msg in _sel
                set _subj to _msg's subject
                set _subj to my replaceString(_subj, "[", "(")
                set _subj to my replaceString(_subj, "]", ")")
set _messageURL to "[[message://%3c" & _msg's message id & "%3e][" & _subj & "]]"
                set end of _links to _messageURL
        end repeat
        set AppleScript's text item delimiters to return
        set the clipboard to (_links as string)
end tell

Attachment: email-tickler-update.txt
Description: Text document



reply via email to

[Prev in Thread] Current Thread [Next in Thread]