| Fraser Speirs ( @ 2005-01-08 20:34:00 |
How to tag rows in OmniOutliner without cluttering it up
I posted earlier about a GTD workflow in OmniOutliner. Recall that this is what it looked like:

Now, this worked OK, but it had a few flaws that became apparent as soon as I started working with it:
1. Prefixing text to rows is too much visual clutter
David Allen's book talks about people having next-actions lists in the hundreds. I don't have that many, but even in my shorter list of 30 or so, prefixing "[NA]" to every line made it significantly harder to scan the rows.
2. Using sub-items as tags is confusing and distracting
Whenever I saw that a row could be expanded, I was always curious as to what I had stashed away under there. Often I would go in there just to find that it was a bunch of tags.
Fixing it: Styles
I had an epiphany of sorts when I realised that the (amazingly comprehensive) style support in OO3 can be AppleScripted to death. In addition, OmniOutliner Pro lets you give names to styles.

Now, instead of prepending text to a row's content or adding sub-rows, I apply one or more named styles to a row. It is possible to create named styles that have no attributes, so they have no visual effect on the rows that they are applied to.
Firstly, I create 'tag styles' by making attribute-free styles with names beginning with "[Tag]". This lets me find them easily with AppleScript:
The nice thing about this is that, if you ever do want to distinguish rows with a particular tag, you just change the named style and they'll all show up. I use an AppleScript called "Highlight Tag":
And then, to clear that highlighting, I simply do:
...which may or may not be what you want if you have some tags that you want permanently styled.
Freestyling it: Quicksilver
Having got this basic approach going, I thought about how to make it easier to be lazier. I decided to integrate this with Quicksilver.
In Quicksilver you can find an AppleScript file and then apply a "Process Text" action to it. This calls an "on process text" handler in the script with whatever text you enter in QS.
Here's the script. It takes the text from QS, finds all the projects in the front OO document, asks you which you want to append to, and puts it in there.
I also made a short screen capture video showing it in action. Watch it here (250k).
My AppleScript grammar is still pretty rusty, as you can probably tell.
I posted earlier about a GTD workflow in OmniOutliner. Recall that this is what it looked like:

Now, this worked OK, but it had a few flaws that became apparent as soon as I started working with it:
1. Prefixing text to rows is too much visual clutter
David Allen's book talks about people having next-actions lists in the hundreds. I don't have that many, but even in my shorter list of 30 or so, prefixing "[NA]" to every line made it significantly harder to scan the rows.
2. Using sub-items as tags is confusing and distracting
Whenever I saw that a row could be expanded, I was always curious as to what I had stashed away under there. Often I would go in there just to find that it was a bunch of tags.
Fixing it: Styles
I had an epiphany of sorts when I realised that the (amazingly comprehensive) style support in OO3 can be AppleScripted to death. In addition, OmniOutliner Pro lets you give names to styles.

Now, instead of prepending text to a row's content or adding sub-rows, I apply one or more named styles to a row. It is possible to create named styles that have no attributes, so they have no visual effect on the rows that they are applied to.
Firstly, I create 'tag styles' by making attribute-free styles with names beginning with "[Tag]". This lets me find them easily with AppleScript:
set allTagNames to name of every named style of front document ¬ whose name starts with "[Tag]"
The nice thing about this is that, if you ever do want to distinguish rows with a particular tag, you just change the named style and they'll all show up. I use an AppleScript called "Highlight Tag":
tell front document of application "OmniOutliner Professional"
set allTagNames to name of every named style ¬
whose name starts with "[Tag]"
set selectedTags to ¬
(choose from list allTagNames ¬
with prompt ¬
"Highlight which tags?" with multiple selections allowed)
repeat with aTag in selectedTags
set aStyle to (first named style ¬
whose name is aTag)
(value of every attribute of aStyle ¬
whose name is "text-background-color")
set value of ¬
(every attribute of aStyle whose name is "text-background-color") ¬
to ({59648, 51200, 9435} as RGB color)
end repeat
end tell
And then, to clear that highlighting, I simply do:
tell front document of application "OmniOutliner Professional"
set allTagStyles to every named style whose name starts with "[Tag]"
repeat with aStyle in allTagStyles
set value of every attribute of aStyle to missing value
end repeat
end tell
...which may or may not be what you want if you have some tags that you want permanently styled.
Freestyling it: Quicksilver
Having got this basic approach going, I thought about how to make it easier to be lazier. I decided to integrate this with Quicksilver.
In Quicksilver you can find an AppleScript file and then apply a "Process Text" action to it. This calls an "on process text" handler in the script with whatever text you enter in QS.
Here's the script. It takes the text from QS, finds all the projects in the front OO document, asks you which you want to append to, and puts it in there.
I also made a short screen capture video showing it in action. Watch it here (250k).
using terms from application "Quicksilver"
on process text theString
-- theString is the text in Quicksilver
-- Get the list of projects from OO
tell application "OmniOutliner Professional" to ¬
set projects to topic of every child of front document
-- Get a list of names of projects to append text items to
set userSelection to ¬
(choose from list projects with prompt ¬
"Append to which project/list?" ¬
with multiple selections allowed)
tell application "OmniOutliner Professional"
set selectedRows to every child of front document
-- Same as above OO call, except we're
-- getting the rows here and not their topics
set newRows to {}
-- We use this later to
--select all the newly-created rows
repeat with r in selectedRows
if topic of r is in userSelection then
set newRow to make new row ¬
with properties {topic:theString} ¬
at end of children of r
set newRows to newRows & {newRow}
set expanded of every ancestor of newRow to true
end if
end repeat
select newRows -- Make newRows the selection
end tell
end process text
end using terms from
My AppleScript grammar is still pretty rusty, as you can probably tell.