The Omni Group Forums

The Omni Group Forums (http://forums.omnigroup.com/index.php)
-   OmniFocus Extras (http://forums.omnigroup.com/forumdisplay.php?f=44)
-   -   ofexport - export to text, taskpaper, html, opml (http://forums.omnigroup.com/showthread.php?t=29081)

psidnell 2013-05-13 11:12 PM

[QUOTE=kingsinger;124003]How do I upgrade to a newer version? I know very little about the command line.[/QUOTE]

Probably the simplest thing is to backup/move/delete your existing installation and go through the [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#downloadinstallation"]install procedure again[/URL].

However, if you're feeling adventurous and want to track the changes more conveniently, you can install [URL="http://git-scm.com/"]git[/URL] from their web site or using [URL="http://www.macports.org/"]mac ports[/URL]. Git is a source code control tool that'll fetch all the changes whenever you want. It's a command line tool but there are plenty of fancy graphical front ends to it if you want to avoid the command line. Github [URL="http://mac.github.com/"]provide their own[/URL] - but I haven't tried it.

But if you've taken the command line route and have git installed, just typing:

[CODE]git clone git://github.com/psidnell/ofexport.git[/CODE]

at the command line will go fetch you a fresh copy in your current directory.

Thereafter, every time you want to get updates just typing:

[CODE]cd wherever-I-installed-it/ofexport
git pull[/CODE]

will fetch any updates - and merge them with any changes you've made - like changes to the runner script to reflect an alternate install location.

(It's probably a good idea if I add a post-download script that fixes up the paths/permissions after a download or update - I'll add that to the next release.)

kingsinger 2013-05-14 08:29 AM

I went with the easier approach, as I don't have macports installed.

So I built the filter below and it's close to what I want, but I'd prefer that the output simply be a flat list of tasks in context mode sorted by due date

In OF lingo is would be ungrouped, sort by due date, next action, any task.

So far my query looks like this:

[CODE]ofexport -p 'note="#currentfocus"' -t next -a flatten -E -a done=any -C -a prune -c "sort due" -T markdown2 --open -o ~/Desktop/x.md
[/CODE]

This output gives me a file where the tasks are grouped by context and then sorted by due date.

If I want to remove the context grouping, do I need to modify my query or is that something I need to change in my template? If it's in the template, how do I change the template to get that result?

psidnell 2013-05-14 10:19 AM

[QUOTE=kingsinger;124042]
If I want to remove the context grouping, do I need to modify my query or is that something I need to change in my template? If it's in the template, how do I change the template to get that result?[/QUOTE]

I just created a template called flat.json and deleted entries for projects, contexts and folders. I also removed any indenting. When I tried it it just gave me a flat list of tasks - is that something like what you're after?

[CODE]
{
"indent": 0,
"dateFormat": "%Y-%m-%d",
"depth": 0,
"Nodes": {
"TaskStart": "- $name",
"TaskGroupStart": "- $name"
},
"NodeAttributeDefaults": {
"date_to_start": "",
"date_due": "",
"date_completed": "",
"link" : "",
"name": "",
"project": "",
"context": "",
"flagged": "",
"note": ""
},
"indentString": "\t",
"NodeAttributes": {
"date_to_start": " @start($value)",
"date_due": " @due($value)",
"date_completed": " @done($value)",
"link": "$value",
"name": "$value",
"project": " @project($value)",
"context": " @context($value)",
"flagged": " @flagged",
"note": ""
}
}
[/CODE]

...EDIT...

Just realised you'll need to write this as a taskpaper or text file, if the tool notices you're writing markdown then there's some custom code that handles the title #'s and line spacing that will insert blank headings.

...EDIT...

V2.1.4 just pushed - it comes with a "flat" template like the above and I've fixed it so it works for markdown - it's a nicer solution :-)

Note that the [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#downloadinstallation"]install procedure is slightly different[/URL] and won't require you to mess with the runner script each and every time.

kingsinger 2013-05-15 02:09 PM

Between filters that exclude certain tasks, etc., I now have the same flat list of tasks visible via ofexport that I have in my of perspective current focus.

But I'm not getting the same sort order when I sort by due date.

Should I be using -t "sort due" if I want to sort the visible tasks by due date? If not, what should I use to make this work? If -t "sort due" is the way to go, where should I place that filter? At the beginning of things? or towards the end of the expression?

kingsinger 2013-05-15 02:43 PM

Also, I think your new install procedure may not be accounting for the relationship between .bash_profile and .bashrc under OSX.

Up until this last install, I had the path info in .bash-profile (at least that how it appears looking at this directory in time machine, as there was no .bashrc until I ran your update script).

It worked fine this way.

I can't seem to post the url I found explaining this, but I think the OSX terminal load bash_profile every time a new window is opened, so that's where it looks for the path info.

Since I upgraded, when I run ofexport, I get this error:


You don't have an OFEXPORT_HOME environment variable set.

Installation instructions can be found here:

kingsinger 2013-05-15 04:19 PM

Actually, once I set the Home variable again in the shell script, it works again. Still confused about sorting by due date, though.

psidnell 2013-05-15 11:09 PM

[QUOTE=kingsinger;124108]
Since I upgraded, when I run ofexport, I get this error:

You don't have an OFEXPORT_HOME environment variable set.
Installation instructions can be found here:[/QUOTE]

Yes there are new install instructions [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#downloadinstallation"]here[/URL]. After download (or git pull) you cd into the ofexport directory and run [B]install.sh[/B] which tells you how to modify your environment - just once. I made this change so that if you upgrade you don't need to keep editing the bash launcher file.

psidnell 2013-05-15 11:20 PM

[QUOTE=kingsinger;124105]Between filters that exclude certain tasks, etc., I now have the same flat list of tasks visible via ofexport that I have in my of perspective current focus.

But I'm not getting the same sort order when I sort by due date.

Should I be using -t "sort due" if I want to sort the visible tasks by due date? If not, what should I use to make this work? If -t "sort due" is the way to go, where should I place that filter? At the beginning of things? or towards the end of the expression?[/QUOTE]

You would want to put the -t "sort due" after any use of -a flatten since you might have had task groups with due dates on the group and different due dates on the child tasks. After flattening the hierarchy the sort order wouldn't make sense.

Also the code simply sorts by the tasks by their due date, substituting the current date for tasks that have none - just as means for preventing a crash. If after your other filters have run you still have tasks with no due date or you have many tasks with the same date - then the final sort order is down to the vagaries of the python sort.

If this still doesn't explain what you're seeing, can you post the command line you're using and I'll see if you've unearthed a bug.

kingsinger 2013-05-16 02:01 PM

Here's what I've got as far as the code I'm entering:

[CODE]ofexport -p 'note="#currentfocus"' -a flatten -t next -E -a done=any -E -t "name='Phase 2: Substantive Work'" -E -t "name='Phase 3: Tie up loose ends and close transaction'" -E -t "name='Phase 1: Admin'" -E -t "name='Document Drafting:'" -E -t "name='Document Review:'" -E -t "name='Invoice and Payment'" -E -t "name='Draft Remaining Formation Paperwork'" -C -a prune -t "sort due" -T flat -v --open -o ~/Desktop/x.txt[/CODE]

It is definitely not sorting according to the due dates on the tasks. Not sorting by name either. Sort order is a bit of mystery. For privacy reasons, I made a template that just has due date and context in it. Here's what the output looks like:

[QUOTE]- @due(2013-04-29) @context(Office)
- @due(2013-05-20) @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @due(2013-04-16) @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @due(2013-05-21) @context(Computer-Offline)
- @due(2013-05-01) @context(Computer-Offline)
- @due(2013-05-13) @context(Computer-Offline)
- @due(2013-04-26) @context(Waiting For)
- @due(2013-04-16) @context(Waiting For)
- @context(Waiting For)
- @due(2013-05-10) @context(E-Mail Follow-Up)
- @due(2013-05-02) @context(E-Mail Follow-Up)
- @due(2013-05-09) @context(Computer-Online)[/QUOTE]

Definitely not sorting by Project Name or Task Name either. So not sure if there's any reason or rhyme to it.

Ideally, if would sort like this, with items missing a due date at the end of the list:

[QUOTE]- @due(2013-04-16) @context(Computer-Offline)
- @due(2013-04-16) @context(Waiting For)
- @due(2013-04-26) @context(Waiting For)
- @due(2013-04-29) @context(Office)
- @due(2013-05-01) @context(Computer-Offline)
- @due(2013-05-02) @context(E-Mail Follow-Up)
- @due(2013-05-09) @context(Computer-Online)
- @due(2013-05-10) @context(E-Mail Follow-Up)
- @due(2013-05-13) @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @due(2013-05-17) @context(Computer-Offline)
- @due(2013-05-20) @context(Computer-Offline)
- @due(2013-05-21) @context(Computer-Offline)
- @context(Computer-Offline)
- @context(Waiting For)[/QUOTE]

psidnell 2013-05-16 11:25 PM

[QUOTE=kingsinger;124183]Here's what I've got as far as the code I'm entering:
[/QUOTE]

I've split it up to make it easier to comment on what I think's happening.

[1] ofexport
[2] -p 'note="#currentfocus"'
[3] -a flatten
[4] -t next
[5] -E -a done=any
[6] -E -t "name='Phase 2: Substantive Work'"
[7] -E -t "name='Phase 3: Tie up loose ends and close transaction'"
[8] -E -t "name='Phase 1: Admin'"
[9] -E -t "name='Document Drafting:'"
[10] -E -t "name='Document Review:'"
[11] -E -t "name='Invoice and Payment'"
[12] -E -t "name='Draft Remaining Formation Paperwork'"
[13] -C -a prune
[14] -t "sort due"
[15] -T flat
[16] -v
[17] --open -o ~/Desktop/x.txt

I think the tool is doing what it's "supposed" to do, but not what you want :-)

Sort Issue 1 - fixable:

[14] -t "sort due" --> -c "sort due"

The [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#sorting"]sort feature[/URL] works by sorting the contents of a structural item. Here you want the contents of contexts sorted so you'd use -c "sort due". This might seem needlessly weird - but I did start out by specifying the items you wanted TO BE sorted, but it didn't work at the conceptual level. The problem is that Folders can contain Sub-Folders AND Projects and Context can contain Sub-Contexts AND Tasks. To say that you want a particular type in sort order doesn't cover the case where two types are mixed in the same list.

Sort Issue 2 - Not so fixable:

[15] -T flat

So with the first problem sorted it's all ok? Well no. By the time we get to 15 you should have all your tasks organised into contexts and all the tasks within them sorted by due. However the flat template simply omits the parent contexts in the output, the internal structure remains. So what you'd see would be blocks of tasks in sort order but then a discontinuity as it jumped to the next context.

In hindsight the "flat" template is a bit of a hack, I think what's required is a filter like the flatten filter but that pulls all the tasks up to the root in the model so that the other filters (like sort) can do their thing on that.

I might have a look at that, it would seem to be quite useful and avoids the need for template hackery.


All times are GMT -8. The time now is 05:02 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.