Capture OmniFocus Tasks on Windows with AutoHotKey

omnifocus
windows
Capture OmniFocus Tasks on Windows with AutoHotKey
0

(Justin DiRose) #1

I’ve been experimenting with using OmniFocus again lately. Using Windows at work has been a barrier, especially for capture and management of tasks. There are a few ways to capture from Windows, including setting up your Exchange-synced task list as the Reminders list in OmniFocus. That feels a little too cumbersome to me, so I wanted to try a different approach.

Below is an AutoHotKey script to create a quick capture window for OmniFocus. Here’s how it works:

  • Install AutoHotKey, save this in a file ending in .ahk (be sure to edit the script to include your OF email address).
  • Run the file.
  • Trigger the shortcut with Ctrl+Shift+D
  • Type in the task you want to capture
  • Hit Enter
  • The script will open an email in whatever email client is set to default with the subject and email already populated.
  • From there, hit send (Alt+S for Outlook) and it’s off!
    ^+d::
    MailList := "<your OmniFocus email address>"

    InputBox, task, Capture to OF, Enter Task, , 640, 480

    GoTo, EmailThem
    Return

    EmailThem:
    Run, mailto:%MailList%?subject=%task%
    Return

Let me know what you think about this and if you need/want any changes made.


Let's Talk Business
#2

Hi!

I Also have a similar setup, but i wanted to skip having the mail client open at all times and using my personal email for that, so i signed up to Mailgun (any Transactional Email would do, but mailgun is free until 10000 mails/month that is much more than tasks i would send) and i use this two scripts:
In autohotkey i have this “script”


psScript := "C:\PATHTOTHEPOWERSHELLSCRIPT"

Pause::
    InputBox, description, Add task to Omnifocus,,,,100
    if ErrorLevel
        Return
    else
        ; Run, powershell.exe "%psScript%" '"%description%"'
        Run, %comspec% /c "powershell -file %psScript% "%description%"",,Hide
    Return

And then i’ve a powershell script that uses the mailgun smtp server to send an email, you could also use the email API but i found this simpler:

$EmailFrom = "ORIGIN@EMAIL"
$EmailTo = "DESTINATION@EMAIL"
$Subject = $args[0]
$Body = $null
$SMTPServer = "smtp.mailgun.org"
$SMTPClient = New-Object Net.Mail.SmtpClient($SmtpServer, 587)
$SMTPClient.EnableSsl = $true
$SMTPClient.Credentials = New-Object System.Net.NetworkCredential("USERNAME", "PASSWORD");
$SMTPClient.Send($EmailFrom, $EmailTo, $Subject, $Body)

This way you just click the autohotkey key, put the text and click ok, everything is invisible and your email “send items” is not flooded with one line emails to your task manager.


(Ed M) #3

OmniGroup recently announced they will begin beta testing of the OmniFocus web app later this year (requires OF3 for iOS and later for macOS). That will become another method on Windows, eventually.


(Joe Buhlig) #4

This is super smart, @Adeiko! Background emails being sent. :wink: