• Stars
    star
    122
  • Rank 292,031 (Top 6 %)
  • Language
    Ruby
  • Created over 13 years ago
  • Updated almost 8 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Ruby CLI for OmniFocus

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

More Repositories

1

doing

Ruby
1,036
star
2

mdless

Ruby
787
star
3

Slogger

Social logging script for Day One
Ruby
762
star
4

KeyBindings

DefaultKeybindings.dict for Mac OS X
HTML
689
star
5

cheaters

Customizable cheat sheet system for OS X
HTML
461
star
6

popclipextensions

Brett's PopClip Extensions
Python
431
star
7

MarkedCustomStyles

Custom Style Repository for Marked2.app
CSS
416
star
8

QuickQuestion

A simple, text-based system for building an easily-searchable knowlegebase on OS X. CLI, LaunchBar and Alfred included.
Shell
188
star
9

Brett-s-TextExpander-Snippets

General-use snippets for TextExpander on Mac
PHP
129
star
10

fish_files

Shell
125
star
11

na

Bash function for displaying next actions in plain-text files per project directory
Shell
113
star
12

nvremind

A scheduled background task to scan nvALT notes for @reminder() tags and trigger notifications based on dates.
Ruby
98
star
13

bunch

Documentation repository for Bunch.app
Ruby
88
star
14

vitag

Ruby
86
star
15

hookapp

HTML
81
star
16

Pinboard-to-OpenMeta

Saves Pinboard bookmarks as local webloc files on a Mac. Can add thumbnails and save PDF's, with external apps. Works with Tags.app or the OpenMeta cli utility.
Ruby
79
star
17

gather-cli

Swift
73
star
18

JekyllPlugins

A small collection of (often lame) Jekyll plugins
SCSS
65
star
19

ubersicht-widgets

CoffeeScript
62
star
20

niftymenu

JavaScript
59
star
21

hook_goodies

AppleScript
59
star
22

snibbets

Ruby
46
star
23

where

Shell
38
star
24

BetterTouchTool-Widgets

Ruby
38
star
25

searchlink

Ruby
34
star
26

howzit_old

Ruby
32
star
27

ExtraInfoPlus

AppleScript
32
star
28

blogsmith-tmbundle

TextMate bundle for blogging platforms with poor/no xmlrpc support
Ruby
31
star
29

bookmark-cli

CLI for OS X that returns a base64 string of bookmark data for a file, or locates a file given a base64 string
Objective-C
31
star
30

popupsCSS

iOS-esque popup styles
28
star
31

jquery-tldr

JavaScript
26
star
32

dotfiles

Various config files
Shell
24
star
33

tagbak

Ruby
24
star
34

nvWikiLink

Universal system for creating plain text wiki links to nvALT notes
Ruby
22
star
35

sidecar

Sidecar jacket for Simplify
HTML
19
star
36

jtag

Ruby
19
star
37

coughbutton

An iPhone-based cough button for your Mac using PHP and MuteMyMic
JavaScript
18
star
38

delimport-pinboard

Index your Pinboard bookmarks using Spotlight on Mac OS X.
Objective-C
18
star
39

CodeReminder

Ruby
17
star
40

MarkdownURLs.safariextension

The source for the TabLinks Safari Extension
JavaScript
16
star
41

na_gem

a command line tool for adding and listing project todos
Ruby
16
star
42

mmd2cheatset

Ruby
16
star
43

howzit

Ruby
14
star
44

notehub

Ruby
14
star
45

reiki

Shell
13
star
46

Character-pair-autocompletion

Character pair autocomplete is now possible on any Mac app using these TextExpander custom snippets including on selected text.
13
star
47

ttscoff.github.com

Brett Terpstra's GitHub website
CSS
12
star
48

bunchcli

Ruby
12
star
49

Twilight2.tmTheme

A mod of the classic Twilight theme for TextMate and Sublime Text
11
star
50

starter-book

An online book.
11
star
51

Sublime-Bunch

Bunch is a Mac automation app that runs on plain text files with the extension `.bunch`. It has its own "language", and this package provides syntax highlighting for Bunch files, as well as light/dark color schemes, snippets for common commands, and completion for app names.
Python
10
star
52

VSCode-Bunch

9
star
53

podtagger

Automated ID3 tagging for podcasts
Ruby
9
star
54

TextBuddyScripts

JavaScript
9
star
55

TabLinks

HTML
8
star
56

loadbar

CoffeeScript
8
star
57

LuckyCharms-tmTheme

A light theme for Sublime Text, VS Code, and Vim
Vim Script
8
star
58

fuzzy_cd

Shell
6
star
59

MailMateMate.mmBundle

Ruby
6
star
60

quix-mann

Merlin Mann's Custom Quix Commands
6
star
61

bookmarklets

Repo to run bookmarklets from inline scripts on github.com
JavaScript
5
star
62

omf-fuzzy_cd

Shell
4
star
63

EditScript

Ruby
3
star
64

marky-api

SCSS
2
star
65

itunescontrol-tmbundle

iTunes Controller for TextMate, highly experimental
Ruby
2
star
66

Dictionary-tmbundle

Various dictionary, spellchecking and thesaurus commands for TextMate
2
star
67

omf-packages

1
star
68

Marked

Marked.app - MultiMarkdown Preview Everywhere
1
star
69

homebrew-thelab

Ruby
1
star
70

htmlexperiments

Just dicking around
1
star