Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
Last active August 4, 2020 08:13
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save brandonpittman/fd582d21eb00c12450b8 to your computer and use it in GitHub Desktop.
Save brandonpittman/fd582d21eb00c12450b8 to your computer and use it in GitHub Desktop.
A simple shell function to create tasks in OmniFocus
#!/bin/zsh
# If you use #'s for defer and start dates, you'll need to escape the #'s or
# quote the whole string.
function of () {
if [[ $# -eq 0 ]]; then
open -a "OmniFocus"
else
osascript <<EOT
tell application "OmniFocus"
parse tasks into default document with transport text "$@"
end tell
EOT
fi
}
@jagipson
Copy link

This is very useful, however, I've been unable to locate comprehensive documentation for the correct format for transport text. Is it in the OmniFocus manual?

@brandonpittman
Copy link
Author

I believe it's in the manual.

It goes like this:

some task! @context ::project #defer #due //note

@skalarproduktraum
Copy link

This is so useful, big thanks!

@lters
Copy link

lters commented Nov 24, 2015

To make this work, you need one more line of code, right?

Call the function or nothing will happen...

of "$@"

@sartak
Copy link

sartak commented Jan 6, 2016

@lters, this snippet is meant to be put into your zsh config so you can run of hello world from the command line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment