Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
Last active August 4, 2020 08:13
Show Gist options
  • Select an option

  • Save brandonpittman/fd582d21eb00c12450b8 to your computer and use it in GitHub Desktop.

Select an option

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
Copy Markdown

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
Copy Markdown
Author

I believe it's in the manual.

It goes like this:

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

@skalarproduktraum

Copy link
Copy Markdown

This is so useful, big thanks!

@lters

lters commented Nov 24, 2015

Copy link
Copy Markdown

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

Call the function or nothing will happen...

of "$@"

@sartak

sartak commented Jan 6, 2016

Copy link
Copy Markdown

@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