Showing posts with label Mac OS X. Show all posts
Showing posts with label Mac OS X. Show all posts

OmniFocus + Evernote

A standing opinion about Evernote is that it's fantastic at accepting information but terrible at giving it up again. You can search from within the app, but any kind of integration with other apps is only barely possible—by, say, linking to the Evernote web client.

OmniFocus, for its part, is exceptional at helping you organize your life, but really isn't designed to be a repository of detailed information, so integration with Evernote is a natural desire. For example, I have an OmniFocus single-action list which I use to store blog post ideas; it's a natural next step to have an Evernote note associated with each containing notes and drafts.

So here's the method (admittedly, somewhat manual) that I've been using to keep references to Evernote notes with associated OmniFocus actions.

Read More...

Plaintext task list from OmniFocus with AppleScript

I live in OmniFocus most of the day. I have lots of perspectives set up to help me parse my various responsibilities (see my previous post, "How I Use OmniFocus," for more details); in particular, I have one perspective called "Global Tasks" (View Mode: Context, Filter: Active, Grouping: Ungrouped, Sorting: Due, Action Filter: Next Action) that essentially gives me a list, ordered by dueness, of what I should be doing right now.

It helps me focus to have that list of tasks constantly in front of my eyes. This is counterbalanced by my desire to save screen real estate for the assorted terminal windows and browsers I need up to do my job; OmniFocus takes up valuable real estate. So I set about writing a quick script to pull tasks from OmniFocus, format them, and return them as plain text, which I could embed on my desktop with GeekTool.

set taskList to ""
tell application "OmniFocus"
tell the default document to tell the front document window
set perspective name to "Global Tasks"
set oTrees to trees of content
set n to count of oTrees
repeat with i from 1 to n
set oTask to value of (item i of oTrees)
set taskTitle to name of oTask
set projTitle to name of containing project of oTask
set taskList to taskList & taskTitle &
" (" & projTitle & ")\n"
end repeat
end tell
end tell
return taskList

I saved that as ~/src/omnifocus_tasks.scpt and added a Command item to GeekTool that ran osascript /Users/ian/src/omnifocus_tasks.scpt every minute. The result was exactly what I wanted:



Now, even if I hide OmniFocus to make room for something else, I can't forget to check for my next tasks and keep everything up to date.

Read More...

Upgrade bash to 4.0 in Mac OS X

bash 4.0 was released last month, and I'm only now getting around to messing with it. So far the things I use most are the '**' recursive globbing and the 'autocd' option. Here's how I upgraded my system and a few ways I use the new features.

  1. Download, build and install. Get the source tarball:
    $ wget ftp://ftp.cwru.edu/pub/bash/bash-4.0.tar.gz

    Build and install:
    $ tar xzf bash-4.0.tar.gz
    $ cd bash-4.0
    $ ./configure && make && sudo make install

    On my system (Leopard + Xcode) I had no trouble compiling. The binary is installed at /usr/local/bin/bash. You can also install via MacPorts or Fink, I imagine, but I try to do these things myself when possible, if only for the sake of transparency.

  2. Configure to use the new shell. First, register the new binary as a valid shell:
    $ sudo bash -c "echo /usr/local/bin/bash >> /private/etc/shells"

    Then change your user to use it as its shell with chsh (this is blatantly obvious, but modify the "Shell" line to point to /usr/local/bin/bash).
    Now open a new shell (restarting Terminal.app will do, or just Cmd-N for a new window) and make sure your changes took:
    [ian@iansmbp] ~/> echo $SHELL
    /usr/local/bin/bash
    [ian@iansmbp] ~/> echo $BASH_VERSION
    4.0.0(1)-release

  3. Enable the new features. There's a bunch of features in the 4.0 release that I haven't gone through yet, including coproc, improved programmable completion, a new &>> redirect operator (synonym of the old >>myfile 2>&1 pattern) and new case-insensitive expansion options. You can peruse a list of the new stuff at your leisure. For immediate gratification, however, just turn on recursive globbing and autocd:
    $ echo "shopt -s globstar autocd" >> ~/.profile
    $ source ~/.profile

    ** matches contents recursively. For example, where you might previously have recursively removed all your byte-compiled Python modules with:
    $ find . -name \*.pyc | xargs rm -f

    You can now simply:
    $ rm -f **/*.pyc

    If you've got a deep directory structure, and you want to get into a subdirectory whose name you know, you can replace:
    $ cd path/to/the/directory/i/want/named/mydir

    with:
    $ cd **/mydir

    Hey, and if those extra three characters at the beginning of that last command are too much for you, then you'll love the autocd option, which, when enabled, permits you to cd to a directory merely by typing its name:
    [ian@iansmbp] ~/src/zenoss/core/Products/> **/yui
    cd ZenWidgets/skins/zenui/yui
    [ian@iansmbp] ~/src/zenoss/core/Products/ZenWidgets/skins/zenui/yui/>


More on new features as warranted; these two, however, are those of zsh that I missed most.

Read More...