docs » SendToOmniFocus

Handles "send current item to OmniFocus" for multiple applications

The following applications are supported: out of the box: Outlook, Evernote, Mail, Chrome and any Chrome-based apps (such as SSBs created by Epichrome)


API Overview

API Documentation


Signature SendToOmniFocus.actions
Type Variable

Table containing application handlers for sending the current item to OmniFocus. Each entry's key is the application name, and its value is another table with the following keys:

  • itemname - how to name the current item in the context of the application. Purely for cosmetic purposes in the notifications (e.g. in Mail, the notification says "filing message" instead of "filing item". Defaults to "item".
  • One of the following, invoked to do the actual filing:
    • as_scriptfile - path of a file containing AppleScript code. It will be executed using the osascript command. If quickentrydialog is set to false, the string nodialog will be passed as argument to the script.
    • as_script - string containing AppleScript code. There is no way to pass an argument to the script via this method.
    • fn - a function. It will be passed a boolean indicating the value of quickentrydialog.
    • apptype - a predefined "application type" to trigger different behavior for application families. The only valid value at the moment is "chromeapp", which can be used for any Chrome-based applications, including Google Chrome itself and, for example, any site-specific browsers generated using Epichrome.

The built-in handlers for Outlook, Evernote, Chrome and Mail are implemented by scripts bundled with the SendToOmniFocus spoon. New handlers can be registered using SendToOmniFocus:registerApplication()

Default value:

     ["Microsoft Outlook"] = {
        as_scriptfile = _resource_path("scripts/outlook-to-omnifocus.applescript"),
        itemname = "message"
     Evernote = {
        as_scriptfile = _resource_path("scripts/evernote-to-omnifocus.applescript"),
        itemname = "note"
     ["Google Chrome"] = {
        apptype = "chromeapp",
        itemname = "tab"
     Mail = {
        as_scriptfile = _resource_path("scripts/mail-to-omnifocus.applescript"),
        itemname = "message"
Signature SendToOmniFocus.logger
Type Variable

Logger object used within the Spoon. Can be accessed to set the default log level for the messages coming from the Spoon.

Signature SendToOmniFocus.notifications
Type Variable

Boolean to control Hammerspoon-generated notifications when filing items (doest not control AppleScript notifications, if any, generated from within the scripts). Defaults to true.

Signature SendToOmniFocus.quickentrydialog
Type Variable

Whether to display the new tasks in the OmniFocus quick-entry dialog before adding them. Defaults to true (set to false to send directly to the Inbox, without prompting)


Signature SendToOmniFocus:bindHotkeys(mapping)
Type Method

Binds hotkeys for SendToOmniFocus


  • mapping - A table containing hotkey objifier/key details for the following items:
    • send_to_omnifocus - file current item to OmniFocus.
Signature SendToOmniFocus:registerApplication(app, handlerSpec)
Type Method

Register a new application handler


  • app - application name
  • handlerSpec - a handler definition in the format of SendToOmniFocus.actions, or nil to unregister the application.
Signature SendToOmniFocus:sendCurrentItem
Type Method

Send current item in current application to OmniFocus by triggering the appropriate handler.


  • None


  • The SendToOmniFocus object