GithubHelp home page GithubHelp logo

otask's Introduction

This is a CLI for OmniFocus. I had an AppleScript/Ruby monstrosity that actually worked with TaskPaper, The Hit List, Things and OmniFocus, but that one got out of hand. I took the good parts of it, concentrated on OmniFocus and converted it to appscript. The result is OTask.

I don't know how long appscript is going to work for us, and it's now a dead project. I make no promises. This version of oTask has been tested on Ruby 2.0 (Mavericks) and with OmniFocus and OmniFocus 2.

Installation

$ [sudo] gem install otask

Note: If you use Xcode 5.1 and have trouble installing the gem, see this post for a fix.

Documentation

OTask uses a custom syntax to allow entry of the various elements of an action in one line of text. The following formats can be used anywhere in the line, with the exception of the flag (!) which must be the last character on the line, preceded by a space.

  • @context (fragment, no spaces)
  • #project (fragment, no spaces)
  • due(due date) (can be shortened as d(date))
  • create(creation date) (can be shortened as c(date))
  • (notes)
  • ! (sets task as flagged)

Contexts and project specifiers should not include spaces. The algorithm that is used will find the best match for the string you give it, so you only need to include enough of it to distinguish it from other contexts or projects. For example, if I were going to put an action directly into my Markdown QuickTags folder, I could just use "#mdqt" and it will find it. "@corr" will get me the "correspondence" context.

Dates are entered in natural language format. You can type "tomorrow," "in 3 days," "next tuesday," etc. You can also use "+3" to set a date 3 days from the current day, "+7" for a week, and so on.

Command line options

-h, --help Displays help message
-q, --quiet Output as little as possible, overrides verbose
-V, --verbose Verbose output
-g, --growl Use Growl for feedback

Example usage

$ otask "Write a letter to mom"

This will put a task into your inbox with the name "Write a letter to mom." Nothing else will be set, it will wait there for you to pick it up.

$ otask -g "Pick up the kids from school @err #single due(today 3pm) !"

This creates a new task in a project called Single Tasks, with a context of "errands", a due date of 3pm on the current day, and flags the task.

The task will go to your inbox by default, and--if provided--project and context will be set. Your settings for automatic cleanup will determine what happens after that. Task elements not specified are left unset.

The -g parameter gives us our feedback via Growl, which is handy if you're calling it from a background script or application launcher like Quicksilver or LaunchBar.

$ otask "Brainstorm for the morning meeting (Bill had some ideas, it might be worth checking in with him this afternoon) d(tomorrow 8am) #hipstartup @think"

This will create a task with a note. Everything in parenthesis is removed from the task name and placed into the notes of the action, sans parenthesis. Note that the due date prefix can be shortened to just "d".

OTask looks for notes in parenthesis, but it can also receive piped input from other applications as a note for the task. If you wanted to include text from a file, the output of a command or the plain-text contents of your clipboard, you can just pipe the output into the command, specifying the rest of the options as usual.

$ pbpaste | otask "Notes from the morning meeting @ref"

That would take the current contents of your clipboard and make them the attached note on the "Notes from the morning meeting" task (with the context "reference").

Calling from LaunchBar (et al.)

You can do this with any app that can run a script with input, or call it from automated scripts if you could think of a reason to. Below is the AppleScript for a LaunchBar action. Create a new script in AppleScript Editor and paste the code in. Edit the path in the last function to point to wherever you put the otask script. Save the AppleScript as OTask.scpt in ~/Library/Application Support/LaunchBar/Actions.

You'll find the Action in LaunchBar after it indexes. Type 'ota' (or as much as you need to get it to come up) and then press space bar. Use the syntax shown above to write out your action and its elements, but leave out the 'otask' part and any parameters. Hit return and Growl (you have it installed, right?) will tell you what's up.

on handle_string(actionString)
	if (length of actionString is not 0) then
		my runRubyScript(actionString)
	end if
	open location "x-launchbar:hide"
end handle_string

on runRubyScript(action)
	do shell script "/usr/bin/otask -g \"" & action & "\""
end runRubyScript

Author

Brett Terpstra

Copyright

Copyright (c) 2011 Brett Terpstra. Licensed under the MIT License:

http://www.opensource.org/licenses/mit-license.php

otask's People

Contributors

davidnunez avatar joshsmoore avatar levelbossmike avatar rrgayhart avatar ttscoff avatar zenspider avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

otask's Issues

Support RVM

I forked and will investigate how to do this myself, but I wanted to post it here too. I try to keep my rubies and gemsets all nice and segregated so it would be nice if OTask played nicely with RVM using a gemset and specific Ruby if available.

Is this gem still supported? Receiving errors when installing...

 ~/documents/projects/dev/angular/angular-sandbox   master  gem install otask
Building native extensions.  This could take a while...
ERROR:  Error installing otask:
    ERROR: Failed to build gem native extension.

    current directory: /Users/mikee/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/rb-appscript-0.6.1
/Users/mikee/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20160716-66980-1igmx62.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Support for Ruby 2.2.0 with system-wide Chruby

Otask worked great on Ruby 2.1.5 running with Chruby. When I try to install Otask while running Ruby 2.2.0 with Chruby, however, I get the following output:

~ gem install otask
Building native extensions.  This could take a while...
ERROR:  Error installing otask:
    ERROR: Failed to build gem native extension.

    /Users/christopherwatson/.rubies/ruby-2.2.0/bin/ruby -r ./siteconf20150131-6600-1qporwq.rb extconf.rb
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
    --with-opt-dir
    --with-opt-include
    --without-opt-include=${opt-dir}/include
    --with-opt-lib
    --without-opt-lib=${opt-dir}/lib
    --with-make-prog
    --without-make-prog
    --srcdir=.
    --curdir
    --ruby=/Users/christopherwatson/.rubies/ruby-2.2.0/bin/$(RUBY_BASE_NAME)
extconf.rb:44:in `<main>': uninitialized constant Config (NameError)

extconf failed, exit code 1

Gem files will remain installed in /Users/christopherwatson/.gem/ruby/2.2.0/gems/rb-appscript-0.6.1 for inspection.
Results logged to /Users/christopherwatson/.gem/ruby/2.2.0/extensions/x86_64-darwin-14/2.2.0-static/rb-appscript-0.6.1/gem_make.out

Don't require Omnifocus to open

One of the benefits to having the command line version is to not have to run Omnifocus just to add a task. Binary Ghost's OmnifocusCLI did this, which was wonderful to my workflow (I'm easily distracted). Any chance this could happen? I'd take a whirl myself but I'm no ruby dev.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.