View Single Post

It can be useful to glance at a key action list on the desktop, without having to fire up OmniFocus and choose a perspective. (A due now list perhaps, or due soon, or a context list, or simply the inbox, as a spur to getting it clear).

This post splits off from another thread which began by discussing ways of displaying a desktop banner of the current action, and drifted off topic towards Geektool.

I posted a couple of rather rudimentary scripts to that thread (for getting particular - unformatted and unwrapped - OF lists into a Geektool window), but here is a much more general script which enables you to attach a range of customized list specifiers to one or more Geektool 'windows' (shell geeklets) at the same time.
Displays one or more custom action lists (or project lists) on your desktop, even when OmniFocus isn't running, using GeekTool.

The lists can be wrapped to fit the geeklet window, shifted to upper case, or generally modified by piping them through shell commands.
Some simple queries are pre-defined by the script,
in inbox
due soon
due now
next action
in context <Context Name>
in context "Phone"
in context "Library"
selected actions

[selected actions does, of course, require OmniFocus to be running - it lists the actions currently selected in the OF GUI]
and these can all be modified, for example to adjust sort order,
in inbox order by dateAdded
in inbox order by dateAdded DESC
in inbox order by dateDue, dateAdded
due now order by effectivedateDue
next action order by effectiveDateDue
in context "Library" order by

and/or further restrict contents.
next action and flagged=1
next action and flagged=0 order by effectiveDateDue
Their format can be adjusted by piping them through further shell commands, like fold and tr.
Wrapping with 'fold'
inbox order by dateDue, dateAdded | fold -s -w 50
in context "Phone" | fold -s -w 30
Shifting to upper case with 'tr'
due now order by effectiveDateDue | tr "[:lower:]" "[:upper:]" | fold -s -w 40
active selections order by name | tr "[:lower:]" "[:upper:]" | fold -s -w 40
(or anything else which can be achieved by piping to another shell command).
More sophisticated queries can be devised in Sqlite SQL.
Project / Projects is a pre-defined alias,
and a set of relative date expressions can be used in the SQL clauses.
yesterday, today, now, soon
<jan> ... <dec> (Interpreted as references to midnight at the start of the first day of the next (or current) month of that name).

today +1w, now +2d etc.
The default list header is $Q ($N) & return where $Q is a variable representing the query, and $N is the number of matches.
In addition, a custom header can now be specified for a List/Geeklet by following the query with the switch --header= followed by an unquoted string, optionally including $Q or $N
  • Due Soon --header=$Q [$N matches]: | fold -s -w 40
  • task where flagged=1 order by projectinfo, dateDue --header=Flagged ($N)\n | fold -s -w 40
  • or simply (to display no header at all) Active Selections --header= | fold -s -w 40

Note that additional blank lines in (or at the end of) the header can be specified as \n
  1. Choose a home for this script (if you put it in the OmniFocus script directory it will appear in the OF script menu, and can be installed on the OF toolbar). (~/Library/Scripts/Applications/Omnifocus )
  2. Install Geektool
  3. Drag one or more shell windows from the GeekTool preference pane onto your desktop, select each of your shell windows in turn, and use the properties dialog to assign it:
    • A name (at the top of the properties dialog - it says "optional" but this script needs each of your Geeklets to have a name).
    • The colours and font that you want (not urgent, these can be changed later),
    • A time out period of 5 seconds, and refresh interval of 10+ seconds. (lists that won't change rapidly can obviously be refreshed less frequently).

      (Note that there is no need to assign a command - that will be done automatically by this script.)
  4. Launch this script.

  1. Run this script,
  2. choose a shell geeklet from the list that appears,
  3. and respond the prompt by typing the name of a simple or modified query.
It may be helpful to begin your experimentation by simply accepting the default query which is offered.
If an error message appears in your geeklet, run this script again and carefully check the spelling and syntax of your list description.
Attached Files
File Type: zip (44.8 KB, 1663 views)

Last edited by RobTrew; 2012-01-25 at 11:41 AM..