The Omni Group
These forums are now read-only. Please visit our new forums to participate in discussion. A new account will be required to post in the new forums. For more info on the switch, see this post. Thank you!

Go Back   The Omni Group Forums > OmniFocus > OmniFocus Extras
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
ofexport - export to text, taskpaper, html, opml Thread Tools Search this Thread Display Modes
Quote:
Originally Posted by kingsinger View Post
How do I upgrade to a newer version? I know very little about the command line.
Probably the simplest thing is to backup/move/delete your existing installation and go through the install procedure again.

However, if you're feeling adventurous and want to track the changes more conveniently, you can install git from their web site or using mac ports. 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 provide their own - 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
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
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.)

Last edited by psidnell; 2013-05-13 at 11:26 PM..
 
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
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?
 
Quote:
Originally Posted by kingsinger View Post
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?
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": ""
    }
}
...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 install procedure is slightly different and won't require you to mess with the runner script each and every time.

Last edited by psidnell; 2013-05-14 at 11:22 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?
 
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:
 
Actually, once I set the Home variable again in the shell script, it works again. Still confused about sorting by due date, though.
 
Quote:
Originally Posted by kingsinger View Post
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:
Yes there are new install instructions here. After download (or git pull) you cd into the ofexport directory and run install.sh 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.
 
Quote:
Originally Posted by kingsinger View Post
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?
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.
 
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
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)
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:
Originally Posted by kingsinger View Post
Here's what I've got as far as the code I'm entering:
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 sort feature 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.
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Export OO to OPML or Text adgirard OmniOutliner 3 for Mac 0 2012-10-04 11:53 AM
.html extension on dynamic html export pairustwo OmniOutliner 3 for Mac 3 2011-09-10 01:53 PM
Bug - Export as TXT (TaskPaper) Vlad Ghitulescu OmniFocus 1 for Mac 2 2011-04-29 03:36 AM
Pasting Taskpaper-format text into OmniOutliner RobTrew OmniOutliner 3 for Mac 1 2011-01-11 05:00 AM
Export Properties:Notes as HTML Roll Over Text? jeffreykennedy OmniGraffle General 6 2009-10-26 07:40 AM


All times are GMT -8. The time now is 05:32 AM.


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