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-04-12 12:00 AM

ofexport - export to text, taskpaper, html, opml
 
This is a command line tool that directly reads your OmniFocus database and writes text files in a variety of formats.

Instructions [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md"]here[/URL].

Let me know if you have any trouble or ideas.

nickwild 2013-04-13 04:03 AM

Hi,

When I edit the script in Xcode I get command not available. ANy ideas what the problem might be?
Thanks
Nick

psidnell 2013-04-13 05:10 AM

[QUOTE=nickwild;122466]Hi,

When I edit the script in Xcode I get command not available. ANy ideas what the problem might be?
Thanks
Nick[/QUOTE]

I'd hazard a guess that you might have missed a step of the installation instructions [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#downloadinstallation"]here[/URL] or perhaps got the path wrong.

Have you:

1. Modified ofexport so the path to ofexport.py is correct?
2. Set execute permission on ofexport ("chmod +x ofexport")?
3. Modified your $PATH variable so your installation folder is on your path?

If you're running terminal and in your installation directory, type "bash ofexport" on the command line. If it prints out it's options then (1) is OK.

If you type "./ofexport" and it prints it's options then (2) is OK.

Otherwise I'd suspect (3).

psidnell 2013-04-30 12:41 AM

Just made V2.0.0 available.

This version has fancy expression filters e.g:

[CODE]ofexport -E -a done=any -I -t "flagged or (due='to tomorrow')" -o /tmp/ex8-due-or-flagged.taskpaper [/CODE]

creates a taskpaper document with all uncompleted tasks that are flagged or due in the next 2 days.

Usage examples [URL="https://github.com/psidnell/ofexport/blob/master/documentation/examples.md"]here[/URL].

Full documentation [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md"]here[/URL].

I've been using this version for about a week so most of the screamingly obvious bugs are gone but the expression parsing is pretty new so bear that in mind...

kingsinger 2013-05-09 12:37 AM

Is it possible to filter by a perspective?

I have one called current focus that is the 5-10 projects I'm focusing on right now. I find it helpful view that perspective in context view ungrouped, sorted by due date, with availability set to next action, as it tends to give me a list of the 5-10 actions I need to be focusing on.

It would be great if I could put that on my desktop with geektool and hazel.

psidnell 2013-05-09 10:39 AM

[QUOTE=kingsinger;123855]Is it possible to filter by a perspective?[/QUOTE]

Not yet - that would be nice though!

The nearest you can get is to use the filtering to include/exclude the same (or a similar set) of tasks that you see in your perspective.

Something like:

[CODE]ofexport -p 'text="Proj1|Proj2"' -E -a done=any --open -o ~/Desktop/x.taskpaper[/CODE]

Would do the trick, but you'd have to keep it up to date with what projects are current. I have a bunch of little fragments like this that I put in dedicated bash scripts.

Alternatively, a lower maintenance scheme is to "tag" the projects you want to appear in your report by adding something to the notes in your current projects in OmniFocus.

For example by adding "#current" to the notes of a few of your projects you could then use:

[CODE]ofexport -p 'note="#current"' -E -a done=any --open -o ~/Desktop/x.taskpaper[/CODE]

I use this trick for exporting certain items to my calendar.

The problem with ofexport directly using perspectives is that I think the each perspective is stored as a rule that has to be executed in order to derive what's visible in it - and there are several aspects of the visibility of items in the omnifocus database that I've yet to understand (such as if a project/context is paused, or what the next action is). Until I've decoded those I can't really replicate a perspective faithfully.

Detecting the paused/on-hold status is next on my list of things to decipher.

kingsinger 2013-05-09 11:51 AM

Great. That all makes sense. Right now, I'm just trying to get ofexport to run on my machine. I think I installed it correctly (put it in my home directory, etc.). I'm running 10.6.8. Don' t know if that's an issue.

When I issue the "ofexport -?" command in the terminal, this is what I get back:


[CODE]Traceback (most recent call last):
File "/Users/Redacted/ofexport/src/main/python/ofexport.py", line 25, in <module>
from of_to_tp import PrintTaskpaperVisitor
File "/Users/Redacted/ofexport/src/main/python/of_to_tp.py", line 17, in <module>
from fmt_template import Formatter
File "/Users/Redacted/ofexport/src/main/python/fmt_template.py", line 40
self.nodes = {k:Template(v) for (k,v) in data['Nodes'].items()}
^
SyntaxError: invalid syntax[/CODE]

I get something the same message when I run "ofexport -o report.txt".

psidnell 2013-05-09 12:59 PM

[QUOTE=kingsinger;123885]I'm running 10.6.8. Don' t know if that's an issue[/QUOTE]

It probably is, or more specifically it might be your python version.

I'm running OSX 10.8.3 and if I run "python -V" I get 2.7.2.

It looks like your python interpreter is barfing on a "dictionary comprehension", a quick google showed up exactly your problem [URL="https://github.com/cortesi/mitmproxy/issues/90"]here[/URL]. I'd guess you have a pre 2.7 version of python.

Sorry about that, I'd better add some pre-requisites to the release notes :-(

I think it's possible to go fetch a newer version of python and install it without overwriting your system copy - but you're in uncharted waters there.

----

It looks like the first OSX version to get python >= 2.7 was Lion with 2.7.1.
So it definitely won't work for anything older than that without installing a newer python. Hopefully it does at least work on Lion!

Anyone tried it on Lion?

kingsinger 2013-05-09 09:31 PM

Yup, I've got 2.6.1.

Oh well.

JL

psidnell 2013-05-09 11:16 PM

[QUOTE=kingsinger;123900]Yup, I've got 2.6.1.

Oh well.

JL[/QUOTE]

I've added a [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#pre-requisites"]pre-requisites[/URL] section indicating that it won't work with the version of python that ships with Snow Leopard.

It can be upgraded: [url]http://www.python.org/download/releases/2.7.4/[/url] but I don't know what issues are associated with doing that.

RobTrew 2013-05-10 03:52 AM

1 Attachment(s)
[QUOTE=psidnell;123878]if a project/context is paused, or what the next action is)[/QUOTE]

FWIW the [I]ProjectInfo[/I] table contains a [I]status[/I] field (string: active | inactive | done | dropped), and an id in a [I]nextTask[/I] field.

[COLOR="White"]--[/COLOR]

psidnell 2013-05-10 04:27 AM

[QUOTE=RobTrew;123908]FWIW the [I]ProjectInfo[/I] table contains a [I]status[/I] field (string: active | inactive | done | dropped), and an id in a [I]nextTask[/I] field.[/QUOTE]

Thanks. I might have a go at that this weekend.

Update: 'tis done. For simplicity I've mapped context paused state onto active/inactive too.

[CODE]ofexport -p 'status="active"' -p 'text="Home"' -o ~/Desktop/x.taskpaper --open[/CODE]

kingsinger 2013-05-10 04:35 PM

[QUOTE=psidnell;123902]I've added a [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#pre-requisites"]pre-requisites[/URL] section indicating that it won't work with the version of python that ships with Snow Leopard.

It can be upgraded: [url]http://www.python.org/download/releases/2.7.4/[/url] but I don't know what issues are associated with doing that.[/QUOTE]

Yes, I'm trying to understand what, if any issues there might be in doing that. Seems like you can do a straight install or do it through MacPorts or Homebrew. Apparently, different versions are designed to run next to each other. But I haven't learned more than that. Trying to figure out the simplest and safest way to get 2.7.4 on my system.

JL

psidnell 2013-05-10 11:26 PM

I'd forgotten about MacPorts - probably because it just works. MacPorts is great - I use it myself and it maintains a separate install location for everything it fetches so (as you say) it won't blitz your system version and you should be able to uninstall and leave everything as it was.

kingsinger 2013-05-12 09:53 AM

Got Python 2.7.4 installed on my system with the .org installer. Seems to be working. Is there any way to include a query that uses the availability filter in OF (e.g., to only return tasks that are the next action of a project)?

psidnell 2013-05-12 10:55 AM

[QUOTE=kingsinger;123959]Got Python 2.7.4 installed on my system with the .org installer. Seems to be working. Is there any way to include a query that uses the availability filter in OF (e.g., to only return tasks that are the next action of a project)?[/QUOTE]

Not yet, just got status queries working, so I might look at this next.

kingsinger 2013-05-12 05:20 PM

Looking forward to you figuring that out.

kingsinger 2013-05-12 05:23 PM

In case you haven't seen it, this thread might have some info about getting the perspective info out of the cache: [url]http://forums.omnigroup.com/showthread.php?t=29538[/url]

psidnell 2013-05-12 11:38 PM

[QUOTE=kingsinger;123969]Looking forward to you figuring that out.[/QUOTE]

With the pointer from Rob Trew (thanks!) that turned out to be pretty easy.

In the latest version you can do this now:

[CODE]ofexport -f text=Work -p status=active -t next --open -o ~/Desktop/OF.taskpaper[/CODE]

And it produces something plausible. This is hot off the presses so I don't if there are any lurking weirdnesses yet.

[QUOTE=kingsinger;123969]In case you haven't seen it, this thread might have some info about getting the perspective info out of the cache: [url]http://forums.omnigroup.com/showthread.php?t=29538[/url][/QUOTE]

Thanks, interesting. As an aside I've also had trouble with blobs/unicode when decoding the notes. This might work better than my current soution which is quite slow...

kingsinger 2013-05-13 10:06 AM

How do I upgrade to a newer version? I know very little about the command line.

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.

kingsinger 2013-05-17 09:12 AM

Thanks for your thoughts. Yes, you're right. The whole point of "ungrouped" in OF is that there isn't a sort/grouping at the context level. So the only sort that gets applies is to whatever tasks are in view.

FWIW, when I do -c "sort date", here's what I get:

[QUOTE]- @due(2013-04-29) @context(Office)
- @due(2013-04-16) @context(Computer-Offline)
- @due(2013-05-01) @context(Computer-Offline)
- @due(2013-05-13) @context(Computer-Offline)
- @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)
- @due(2013-04-16) @context(Waiting For)
- @due(2013-04-26) @context(Waiting For)
- @context(Waiting For)
- @due(2013-05-02) @context(E-Mail Follow-Up)
- @due(2013-05-10) @context(E-Mail Follow-Up)
- @due(2013-05-18) @context(Computer-Online)[/QUOTE]

The dates are in the right order within the context, but I don't really understand why the contexts are in the order that they are in.

Anyway, the reason why I'm trying to make this work is that seems like it might be helpful to have relatively short list of the most high priority tasks on the desktop via Geektool, with a Hazel action updating it when the cache changes. I already do that with a different layout of tasks using one of RobTrew's scripts. But I'm starting to feel like it gives me too much info.

A short, flat task list seems like something that could be useful to more people than just me.

I've been using OF since it Kinkless GTD. But it's only relatively recently, when I started doing inbox zero in my e-mail, that I've come to fully appreciate the value of hiding things from view, so it's easier to focus on the few things that are left (which are presumably the things you've determined are most important right now.)

psidnell 2013-05-18 04:04 AM

[QUOTE=kingsinger;124220]A short, flat task list seems like something that could be useful to more people than just me.[/QUOTE]

OK - V2.1.5 is still to hot to hold without tongs, but I've made a change that relate to this.

There's a new filter [B]--tasks[/B] which puts all the unfiltered tasks into a single project/context (depending on mode) e.g:

[CODE]ofexport -o ~/x.taskpaper -C --tasks -E -t done=none -c "sort done" -T taskpaper-lite[/CODE]

[QUOTE=kingsinger;124220]The dates are in the right order within the context...[/QUOTE]

Secondly I've made the sort a bit less dumb - if you're sorting by dates and two dates are equal it ought to show them in the order that they were originally in within OmniFocus.

kingsinger 2013-05-19 02:22 PM

Nice. That's a definite improvement on the grouping. And the sort is much closer too. Here's what I get with the same query I posted above:

[QUOTE]- @due(2013-04-16) @context(Tasks)
- @due(2013-04-16) @context(Tasks)
- @due(2013-04-26) @context(Tasks)
- @due(2013-04-29) @context(Tasks)
- @due(2013-05-01) @context(Tasks)
- @due(2013-05-02) @context(Tasks)
- @due(2013-05-10) @context(Tasks)
- @due(2013-05-13) @context(Tasks)
- @due(2013-05-17) @context(Tasks)
- @due(2013-05-17) @context(Tasks)
- @due(2013-05-17) @context(Tasks)
- @due(2013-05-18) @context(Tasks)
- @context(Tasks)
- @context(Tasks)
- @due(2013-05-20) @context(Tasks)
- @due(2013-05-21) @context(Tasks)
[/QUOTE]

If only there was a way to put the items without a due date after all of the items with a due date, then it would be sorting in the same way that OF sorts in this kind of view (i.e., you see stuff with due dates first and then stuff without due dates after that--not sure how the items without a due date are ordered in OF, perhaps by project?)

Presumably the tasks without due dates sorted where they did, because they get today as the due date, yes? Would there be any way of using the day after the latest occurring due date in the found set as the due date for items with no due date? That would place them at the end of the list, wouldn't it?

psidnell 2013-05-19 11:44 PM

[QUOTE=kingsinger;124297]
If only there was a way to put the items without a due date after all of the items with a due date, then it would be sorting in the same way that OF sorts in this kind of view (i.e., you see stuff with due dates first and then stuff without due dates after that--not sure how the items without a due date are ordered in OF, perhaps by project?)

Presumably the tasks without due dates sorted where they did, because they get today as the due date, yes? Would there be any way of using the day after the latest occurring due date in the found set as the due date for items with no due date? That would place them at the end of the list, wouldn't it?[/QUOTE]

I think this should be a really easy fix. I assume a date in the distant past instead of today then if sorting by start/due then items with no date will naturally drop below items with a date.

psidnell 2013-05-20 12:27 AM

V2.1.6 will put undated items below dated ones when sorting by start or due - which is far more sensible.

kingsinger 2013-05-20 01:33 AM

That seems to work. Thanks!

How would I modify the flat template so that I could put certain info on a second line indented underneath the task. For example this:

-Task: [INDENT]Project[/INDENT]-Task[INDENT]Project[/INDENT]
I don't necessarily want a double space between the two lines. The bulletin board software put that in there.

Also, how would I make a shell script out of one of my queries that I could use to update a geek tool text file via Hazel whenever the OF cache is updated?

psidnell 2013-05-20 10:47 PM

[QUOTE=kingsinger;124314]That seems to work. Thanks!

How would I modify the flat template so that I could put certain info on a second line indented underneath the task. For example this:

-Task: [INDENT]Project[/INDENT]-Task[INDENT]Project[/INDENT]
I don't necessarily want a double space between the two lines. The bulletin board software put that in there.[/QUOTE]

You ought to be able to do something like this on the line for formatting tasks (and you'd probably want it for task groups too):

[CODE]"TaskStart": "- $name\n\t$project",[/CODE]

where:[LIST][*] \n = newline[*] \t = tab[/LIST]
I do something similar in the TaskPaper template to print the link to the OmniFocus task in a note on the next line.

psidnell 2013-05-20 11:17 PM

[QUOTE=kingsinger;124314]... how would I make a shell script out of one of my queries that I could use to update a geek tool text file via Hazel whenever the OF cache is updated?[/QUOTE]


For Hazel, your OF database will likely be in one of these two locations (depending on how you purchased it):
[LIST][*]Library/Caches/com.omnigroup.OmniFocus/OmniFocusDatabase2[*]Library/Caches/com.omnigroup.OmniFocus.MacAppStore/OmniFocusDatabase2[/LIST]
For the script side of things here's an example of one of mine:

[CODE]#!/bin/bash

FILE=~/Desktop/"REPORT-WORK-`date +"%Y-W%V-%h-%d"`.taskpaper"
ofexport \
-T taskpaper-lite \
-o "$FILE" \
-f 'text=^Work$|^Miscellaneous$' \
-E \
-p text=Routine \
-p text=Repeat \
-I \
"$@" \
-a flatten \
-a prune \
-E \
-t text='SEQ|PAR' \
-f sort
[/CODE]

I like breaking the command over multiple lines like this so I can see what's going on. Note that the "$@" is shell variable that inserts any additional command line arguments at that point - allowing you write scripts that use other scripts etc. This is my base "work" script, I have other scripts that use this and add filters for showing and sorting by just due or just done etc. I often run "work --open" to create and open the file, for example.

You'll need to run "chmod +x myscript" on your script ro make it executable (and then make sure it works!) because diagnosing problems when the happen in Hazel is a pain. You may need to refer to your script via it's full path - rather than just by name, I'm not sure where Hazel gets it's environment from.

Finally, the Hazel recipe for generation is something I'm still playing with. I don't want it to run too often (I have about 5 uses of ofexport triggered and it uses a lot of CPU). Also if ofexport is reading continuously, it can block OF from writing so to trigger and throttle I have:

- Full Name is <database>
- Date Last Modified in in the last 5 mins
- Date Last Modified is NOT in the last 4 mins
- Date Last Matched in NOT in the last 4 mins

I don't fully understand exactly how Hazel rules are interpreted but the abve seems to do what I want.

Embedded Script:

[CODE]. /Users/psidnell/.bashrc
/Users/psidnell/Workspace/Bin/hazel/of_modified[/CODE]

psidnell 2013-05-20 11:26 PM

... (out of time for updating the above post) ...

As for GeekTool I'm generating two text files when OmniFocus writes it's database that GeetTool blindly updates once every minute.

I tend to have "Todo" on the left in orange that's an export of everything flagged or due today. On the right I'll have things I've completed today in green.

kingsinger 2013-05-21 02:29 PM

Awesome. Thanks for your help!

nickwild 2013-05-22 01:20 AM

Strange Problem
 
Hi,

Many thanks for this it is awesome. However I have a strange problem using this with Hazel.

I am running this code
[CODE]#!/bin/bash

FILE=/Users/xxxxx/Dropbox/Public/omnifocus.ics

. /Users/nickwild/.bash_profile
ofexport -a=Work -o "$FILE"
ofexport -a=Work -o ~/Desktop/doc.txt[/CODE]

With - Full Name is <database>

When I first make a change to OF it triggers Hazel and writes the files perfectly, however subsequently it ignores any changes to OF and then will only run if I make changes to the code above in Hazel (e.g. Change the order of writing out the text file and the calendar.

Any thoughts as to what might be happening?
Cheers
Nick

kingsinger 2013-05-22 08:41 AM

With Robtrew's scripts that I'm using with Geektool, I've always just used the following in Hazel:

Date modified is after date last matched. So the thing only updates after you update the OF cache.

Is the goal of your recipe to say "update after OF updates, but only if you haven't updated in the last 5 minutes?"

kingsinger 2013-05-22 01:06 PM

Just played around a little bit with the calendar export. It's great that you can put the little tags in individual events to control how due/start dates are determined, but it would also be cool if there were some global level switches that lazy people such as myself could use, so we don't have to tag every entry (e.g., always just use start date for both start and end of calendar entry, or vice versa; or have all OF Tasks imported as all day events starting with start date or due date).

With a little more macro level control, OF events start to take over the calendar, if they have start and due dates that are days apart.

One of the uses I might have for this is getting OF tasks into my calendar on my android phone. Unlike iCal it does have an agenda view, but it's not as easy to show and hide individual calendars in week and day view, so it would be nice to have more control over how the calendar items present themselves.

nickwild 2013-05-22 01:24 PM

Thanks Kingsinger. Just tried that, but it seems to make no difference.

Yes that's exactly my goal. I could get it to run from Lingo, but seems very inefficient.

kingsinger 2013-05-22 10:34 PM

Are you running that code directly in Hazel? Or is that the code of your shell script? My robtrew geektool hazel thing uses a shell script. Don't know if it matters.

nickwild 2013-05-22 11:49 PM

Hi, I was running in Hazel. Will try in a shell script. Thanks.

nickwild 2013-05-23 07:09 AM

Works perfectly now.

Thanks Kingsinger

kingsinger 2013-05-23 02:25 PM

Awesome! That helps me understand better how it works too. I don't understand much about the command line. Can you share with me what you put into Hazel to run your shell script?

That would help me.

Thanks!

psidnell 2013-05-23 02:59 PM

[QUOTE=kingsinger;124438]Just played around a little bit with the calendar export. It's great that you can put the little tags in individual events to control how due/start dates are determined, but it would also be cool if there were some global level switches that lazy people such as myself could use, so we don't have to tag every entry (e.g., always just use start date for both start and end of calendar entry, or vice versa; or have all OF Tasks imported as all day events starting with start date or due date).

With a little more macro level control, OF events start to take over the calendar, if they have start and due dates that are days apart.

One of the uses I might have for this is getting OF tasks into my calendar on my android phone. Unlike iCal it does have an agenda view, but it's not as easy to show and hide individual calendars in week and day view, so it would be nice to have more control over how the calendar items present themselves.[/QUOTE]

I've been wondering about what would make sense here, the magic strings in the notes are a bit of an after-thought.

It wouldn't be hard to add more options to do the same job globally, but it would be nice if it just "did the right thing" on it's own - whatever that is.

I've been using the calendar export quite heavily for a little while now and have a better understanding of what's good/bad about it.

I'll give it some more thought...

kingsinger 2013-05-23 06:22 PM

That should also read "Without a little macro level control...." FWIW.

markokaestner 2013-05-25 11:27 AM

Would it be possible to make the persistentIdentifier of all entities available in the templates as [B]$id[/B]? I tried to add it on my own but the last time I had to deal with Python was about 10 years ago at college.

psidnell 2013-05-25 12:13 PM

[QUOTE=markokaestner;124611]Would it be possible to make the persistentIdentifier of all entities available in the templates as [B]$id[/B]? I tried to add it on my own but the last time I had to deal with Python was about 10 years ago at college.[/QUOTE]

Sure, I use it in some of the templates like ics already.

Out of curiosity, what do you want it for?

markokaestner 2013-05-25 01:08 PM

[QUOTE=psidnell;124614]Sure, I use it in some of the templates like ics already.

Out of curiosity, what do you want it for?[/QUOTE]

Ahh ... didn't notice this. Works fine. I am currently evaluating, if I could replace my own OF code in my Alfred workflow with your ofexport tool. Looks promising so far...

nickwild 2013-05-26 02:48 AM

[QUOTE=kingsinger;124521]Awesome! That helps me understand better how it works too. I don't understand much about the command line. Can you share with me what you put into Hazel to run your shell script?

That would help me.

Thanks![/QUOTE]

Hi kingsinger,

Sorry only just saw this. I replicated psidnell's approach [URL="http://forums.omnigroup.com/showpost.php?p=124350&postcount=38"]here[/URL]

psidnell 2013-05-26 02:54 AM

[QUOTE=markokaestner;124611]Would it be possible to make the persistentIdentifier of all entities available in the templates as [B]$id[/B]? [/QUOTE]

I'm reworking the configuration at the moment and improving the way templates reference attributes, hopefully this will be simpler when I'm done.

psidnell 2013-05-27 04:13 AM

[QUOTE=psidnell;124629]I'm reworking the configuration at the moment and improving the way templates reference attributes, hopefully this will be simpler when I'm done.[/QUOTE]

For the fearless amongst you I've just pushed V3.0.0. This incorporates a few recent suggestions I've had and hopefully paves the way for others I'd like to address.
[LIST][*] Added a plugin model so that templates can use custom layouts better. Much less code.[*] [B]Changed the template format[/B]. Bear that in mind if you've customised yours or created new ones. The new format is more compact, flexible and obvious (I hope).[*] Added some missing attributes to existing templates.[*] Created a global config file for plugin loading and file associations.[*] Misc bug fixes and template tweaks to remove extraneous white space in output.[/LIST]
My tests haven't shown up any problems but these are big internal changes so there might be issues. Let me know if you hit problems.

nickwild 2013-05-27 04:38 AM

Hi,

How do I only select uncompleted tasks.

Status only relates to Projects and Completed is a date.

TIA
Nick

psidnell 2013-05-27 05:16 AM

[QUOTE=nickwild;124656]Hi,
How do I only select uncompleted tasks.

Status only relates to Projects and Completed is a date.

TIA
Nick[/QUOTE]

This will give you just uncompleted tasks by including only tasks which have no completion date.
[CODE]ofexport -t done=none -o ~/Desktop/x.taskpaper --open[/CODE]

However it will also show the completed tasks within the uncompleted group.

If you want to eliminate those too then try this:

[CODE]ofexport -E -a done=any -o ~/Desktop/x.taskpaper --open[/CODE]

If you really dont want to see anything except tasks (no other structure at all) try this:

[CODE]ofexport -E -a done=any --tasks -T flat -o ~/Desktop/x.taskpaper --open[/CODE]

nickwild 2013-05-27 08:01 AM

Perfect! Thanks.

nickwild 2013-05-27 08:43 AM

Exclude Notes
 
Hi,

Sorry for all the dumb questions. Regarding templates how do I exclude the note fields from the output. I have tried removing this from the template but it did not work.

Cheers

Nick

markokaestner 2013-05-27 11:59 AM

I am no longer able to retrieve the list of tasks done today. All the examples no longer work. I tried

[CODE]./ofexport -t done='today' -a prune -T text[/CODE]

[CODE]./ofexport -t done='today' -T text[/CODE]

When I try to export tasks done='last week', the script claims that it does not recognize "last" as a valid date.

jbergenudd 2013-05-27 12:33 PM

all available tasks from one context
 
I would like to export a short textfile for use with geektool

I need just the taskname from one context named 'telephone - private' and just available or next actions



call john 444-3456
call bank about loan
call dentist

kingsinger 2013-05-27 06:27 PM

Got his error exporting to .ics
 
Got this error outputting to .ics file.

of_to_ics ERROR problem parsing cal directives

kingsinger 2013-05-28 10:48 AM

[QUOTE=jbergenudd;124663]I would like to export a short textfile for use with geektool

I need just the taskname from one context named 'telephone - private' and just available or next actions



call john 444-3456
call bank about loan
call dentist[/QUOTE]

You could try something like this:

[CODE]ofexport -C -c "name='telephone - private'" -t next -E -a done=any -T flat -o ~/Desktop/[insert your file name here].txt
[/CODE]

I believe that this puts you in context mode, then finds all next actions with context name "telephone" and puts the found items in the text file using the flat template (which just lists task names, if memory serves).

Not sure that you really need -E done=any (exclude any items that are marked done). It may be that -t next filters those out on its own.

At this point, I don't think ofexport has the ability to use "available" as a filter (i.e., something like -t available).

Perhaps we'll get that in the future.

kingsinger 2013-05-28 10:56 AM

You could also try removing -t next and see what that gets you. It may look more like "remaining" under the OF availability filter.

Then, perhaps there's a way to narrow things further via a filter based on the start date, if you use start dates (e.g start date is before today).

jbergenudd 2013-05-28 12:39 PM

[QUOTE=kingsinger;124693]You could also try removing -t next and see what that gets you. It may look more like "remaining" under the OF availability filter.

Then, perhaps there's a way to narrow things further via a filter based on the start date, if you use start dates (e.g start date is before today).[/QUOTE]

Thanks Kingsinger.

At least I get some text into the text-file now.

unfortunately with -t next I only get true next actions and it doesn't seem that actions in a single action list are treated as next actions...

Also, if you have a parallell project only the first action is a next action, all others are just available. So they wouldn't show up even if I have told the program that all actions can be completed in any order...


and without -t next I get all entries in the context, including actions which I can't act on right now, they are blocked by actions that needs to be done before.

jbergenudd 2013-05-28 01:00 PM

[QUOTE=psidnell;123978]With the pointer from Rob Trew (thanks!) that turned out to be pretty easy.

In the latest version you can do this now:

[CODE]ofexport -f text=Work -p status=active -t next --open -o ~/Desktop/OF.taskpaper[/CODE]

And it produces something plausible. This is hot off the presses so I don't if there are any lurking weirdnesses yet.
[/QUOTE]

Would it be possible to be able to use -t available as well?

psidnell 2013-05-29 02:36 PM

[QUOTE=kingsinger;124668]Got this error outputting to .ics file.

of_to_ics ERROR problem parsing cal directives[/QUOTE]

Was that all it said? Not very helpful :-( it probably barfed on one of the "%of cal ..." Strings. I'll try and beef up the error reporting.

BTW, the next release has incorporated your suggestion for a global default for these calendar directives so if you always want it to do the same thing you can define it once. Going to road test V3.0.1 for another day or so...

psidnell 2013-05-29 02:38 PM

[QUOTE=jbergenudd;124697]Would it be possible to be able to use -t available as well?[/QUOTE]

This is on my list of things to do, I have to reverse engineer the OF database to extract the information - sometimes it's obvious, sometimes not.

jbergenudd 2013-05-29 03:12 PM

[QUOTE=psidnell;124735]This is on my list of things to do, I have to reverse engineer the OF database to extract the information - sometimes it's obvious, sometimes not.[/QUOTE]


Great! Good luck :)

markokaestner 2013-06-01 11:42 AM

Is it the desired behaviour that tasks in the inbox are ignored when filtering for tasks completed today? ofexport shows me all tasks that have been assigned to a project but not the ones that I completed straight from the inbox.

markokaestner 2013-06-02 03:22 AM

I just found out that switching to context mode will also show the tasks from the inbox.

psidnell 2013-06-02 10:09 AM

[QUOTE=markokaestner;124841]I just found out that switching to context mode will also show the tasks from the inbox.[/QUOTE]

That's interesting, I was about to say that it doesn't work yet, but it looks like its does - by accident!

I'd never been able to work out how to extract inbox items and had assumed that they were stored in a special place in the OF database that I hadn't unearthed. However I've recently added a fix for items with no context and I suspect that's had this unexpected bonus side effect.

Unfortunately I suspect that there might be some lurking ofexport bugs in this area since there won't be any project associated with the task and this might cause issues for some of the filters - since I assume there's always one present.

Thanks for the heads-up though, this gives me a lead for supporting inbox items properly.

RobTrew 2013-06-02 10:18 AM

[QUOTE=psidnell;124844]I'd never been able to work out how to extract inbox items and had assumed that they were stored in a special place in the OF database that I hadn't unearthed.[/QUOTE]

Sounds like you've probably found these now:

[CODE]task.effectiveInInbox integer NOT NULL (0|1)
task.inInbox integer NOT NULL (0|1)[/CODE]

psidnell 2013-06-02 10:39 AM

Actually no, so thanks :-) I've just accidentally picked up items with no context, which for many people happens to coincide with inbox items. I think I know where to go next now.

psidnell 2013-06-03 11:18 AM

V3.0.2 now has support for inbox items. It creates an artificial project called "Inbox" and an artificial context called "No Context" and puts inbox items in those as required. This approach means that you can use ofexport filters on inbox items as you would normally.

As ever, let me know if it emits fumes or makes grinding noises in use.

kingsinger 2013-06-03 08:22 PM

[QUOTE=psidnell;124892]V3.0.2 now has support for inbox items. It creates an artificial project called "Inbox" and an artificial context called "No Context" and puts inbox items in those as required. This approach means that you can use ofexport filters on inbox items as you would normally.

As ever, let me know if it emits fumes or makes grinding noises in use.[/QUOTE]

Does this version have the global calendar stuff? Or is that still to be done?

psidnell 2013-06-03 09:24 PM

[QUOTE=kingsinger;124920]Does this version have the global calendar stuff? Or is that still to be done?[/QUOTE]

Yep. If you look in ofexport.json (the new global config file) you can put a default calendar directive in there.

kingsinger 2013-06-04 10:41 PM

[QUOTE=psidnell;124921]Yep. If you look in ofexport.json (the new global config file) you can put a default calendar directive in there.[/QUOTE]

Can you be more specific about how to do that. I'm a bit of an idiote :).

psidnell 2013-06-04 10:59 PM

[QUOTE=kingsinger;124960]Can you be more specific about how to do that. I'm a bit of an idiote :).[/QUOTE]

:-)

Sure:

The ofexport.py file is in the root folder of the install, you can see the copy on github [URL="https://github.com/psidnell/ofexport/blob/master/ofexport.json"]here[/URL].

The [B]file_types[/B] section shows the config for each of the supported output types. If you scroll down to the [B]ICS[/B] section you can see it's got a [B]time_control_default[/B] setting:


[CODE]
"ICS": {
"_1": "time_control_default can contain the magic that you can put in a note to control when the item appears in the calendar",
"_2": "The time_control_default is only used if there is no '%of cal' directive in the node",
"plugin": "ics",
"suffixes": [
"ics"
],
"template": "ics",
"time_control_default": "ignored unless it is of the right format"
},
[/CODE]

So you could put any directive ([URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#calendar-export"]see the doc[/URL]) in there as a default rather than cluttering all your notes.

eg:

[CODE]%of cal allday noalarm[/CODE]

kingsinger 2013-06-05 08:30 AM

[QUOTE=psidnell;124962]:-)

Sure:

The ofexport.py file is in the root folder of the install, you can see the copy on github [URL="https://github.com/psidnell/ofexport/blob/master/ofexport.json"]here[/URL].

The [B]file_types[/B] section shows the config for each of the supported output types. If you scroll down to the [B]ICS[/B] section you can see it's got a [B]time_control_default[/B] setting:


[CODE]
"ICS": {
"_1": "time_control_default can contain the magic that you can put in a note to control when the item appears in the calendar",
"_2": "The time_control_default is only used if there is no '%of cal' directive in the node",
"plugin": "ics",
"suffixes": [
"ics"
],
"template": "ics",
"time_control_default": "ignored unless it is of the right format"
},
[/CODE]

So you could put any directive ([URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#calendar-export"]see the doc[/URL]) in there as a default rather than cluttering all your notes.

eg:

[CODE]%of cal allday noalarm[/CODE][/QUOTE]

Okay. I get it conceptually. But where exactly do I stick "%of cal allday noalarm"?

I do best when I see a concrete example of the thing in context. Does "%of cal allday noalarm" replace "ignored unless it is of the right format"? Does it go before or after it? Or does it go somewhere else entirely?

psidnell 2013-06-06 04:17 AM

[QUOTE=kingsinger;124969]Okay. I get it conceptually. But where exactly do I stick "%of cal allday noalarm"?[/QUOTE]

The changed line would look like this:

[CODE]"time_control_default": "%of cal allday noalarm"[/CODE]

kingsinger 2013-06-07 09:26 AM

Strange behavior with all-day calendar events when I try to import the .ics file onto my android phone calendar. In ical, the events appear as blocks at the top of the week view of the calendar as all day events are supposed to do. But on my phone, they stripe through the entire day, as if I had entered 12:00am to 11:59pm, rather than hitting the all-day button.

Any thoughts?

Perhaps ical is smarter in how it parses the file.

kingsinger 2013-06-07 09:36 AM

Filed is also parsed as expected in Lightning. But when I try to import the .ics file into a google calendar on the web, it says "zero events processed."

kingsinger 2013-06-07 09:50 AM

File is also parsed...

psidnell 2013-06-07 11:15 AM

I have just fixed an issue that might relate to this in the latest version. All day events are encoded in a very specific way in ics files, and I stopped worrying when they displayed OK on my iPhone and iMac calendar. It's possible other clients aren't as happy.

Which version of ofexport are you using?

kingsinger 2013-06-07 04:29 PM

Version 3.0.2

kingsinger 2013-06-07 04:42 PM

3.0.3 fixed the import issue with google calendar. But it did not fix the issues on my phone. Not sure why. Those don't show as all day.

I'm using dropsync to get the .ics to my phone. Then I'm using a program called iCalSync2 to sync the .ics to the phone calendar.

psidnell 2013-06-08 12:20 AM

[QUOTE=kingsinger;125092]3.0.3 fixed the import issue with google calendar. But it did not fix the issues on my phone. Not sure why. Those don't show as all day.

I'm using dropsync to get the .ics to my phone. Then I'm using a program called iCalSync2 to sync the .ics to the phone calendar.[/QUOTE]

I've failed to find good documentation on this, the following two links were the most useful:

- [url]http://stackoverflow.com/questions/1716237/single-day-all-day-appointments-in-ics-files[/url]
- [url]http://icalevents.com/1778-all-day-events-adding-a-day-or-not/[/url]

and I'm using the advice in the second.

I ended up hand crafting a small ics file (it's "just text") and re-syncing with OSX Calendar until it displayed correctly, on the right day and in the right time zone. When that worked I fixed the code to produce the same data.

For those who care, the following code from ics_plugin.py applies this logic:

[CODE]def format_date (item, the_date, is_due_date):
if 'allday' in item.attribs:
# Make all day - must have no hms in format
#DTSTART;VALUE=DATE:20020923
#DTEND;VALUE=DATE:20020924
the_date = datetime (the_date.year, the_date.month, the_date.day, 0, 0, 0)
if is_due_date:
the_date = the_date + timedelta (days=1)
# NO UTC CONVERSION - it happens on the day we asked for - no adjustment required
result = the_date.strftime(DATE_FORMAT_SHORT)
else:
the_date = utc (the_date)
result = the_date.strftime(DATE_FORMAT_LONG)
typ = 'due' if is_due_date else 'start'
logger.debug ("formatted date for %s is %s:%s", item.id, typ, result)
return result[/CODE]


I've had problems with OSX/IOS calendar where it fails to pick up title changes for some time, I think it looks for new/deleted items regularly but doesn't re-sync updated ones every time.

Currently my Calendar apps are subscribed directly to the exported ics file which is published from dropbox and when I force them to update do instantly.

If your phone is displaying the calendar event in the same way as it was before you upgraded to V3.0.3 I'd suspect a cacheing issue.

Sorry for the rambling reply, but hopefully it'll shed some light on what's going on.

kingsinger 2013-06-08 10:02 AM

No, thanks for that reply. Let's see what happens. I have an android table that runs android 4 and that calendar seems to have updated correctly. But my 2.3 phone doesn't seem to be working right. Maybe it'll get sorted out on its own.

kingsinger 2013-06-08 02:32 PM

Also, I'm using IcalSync2 on both by android tablet and my phone. So the difference between the phone and the tablet are as follows:

(a) Different version of Android (4.0 vs. 2.3); and

(b) and different calendar app (on tablet it's the stock calendar app that comes with the cm9 ROM I'm running--although it also seems to work correctly in stock google calendar app; on phone it's an app called calendroid, although I get the same behavior with the HTC stock calendar that shipped with the phone).

Just downloaded a different calendar app to phone and had same problem. So it must have something to do with the way Android 2.3 parses .ics vs. the way Android 4.0 does it.

23dex 2013-06-27 03:38 PM

Thank you psidnell for all the work on this!

I have things working on my machine now, and I can do a basic export. I am having a little bit of trouble understanding how some of the options work, so I wanted to ask about how one would do some things.

Basically, I'd like to export (just to plain text), my non-completed tasks that are due in the next two weeks (or some type of time). I assume there's some way to do this with the "due=" setting, but I am not able to figure it out.

For example, this works for to show tasks due in June:
[CODE]ofexport -E -a done=any -I -t "due=June"[/CODE]

I would like to change this so I could run this every morning, and always report on the next two weeks worth of due tasks. What is the best way to do something like this?

thanks!
Dex

psidnell 2013-06-27 10:56 PM

[QUOTE=23dex;125770]Thank you psidnell for all the work on this![/QUOTE]

Thanks!

[QUOTE=23dex;125770]I have things working on my machine now, and I can do a basic export. I am having a little bit of trouble understanding how some of the options work, so I wanted to ask about how one would do some things.[/QUOTE]

It's not for the feint of heart :-)

[QUOTE=23dex;125770]Basically, I'd like to export (just to plain text), my non-completed tasks that are due in the next two weeks (or some type of time). I assume there's some way to do this with the "due=" setting, but I am not able to figure it out.

...

I would like to change this so I could run this every morning, and always report on the next two weeks worth of due tasks. What is the best way to do something like this?[/QUOTE]

You probably found the date syntax documentation [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#filtering-with-dates"]here[/URL] but things are made more complex by the need to [URL="https://github.com/psidnell/ofexport/blob/master/DOCUMENTATION.md#spaces-and-quotes"]carefully quote things[/URL] to get them through the shell unscathed, that's what catches most people out.

It doesn't have anything like multipliers for the date specs e.g. 2 weeks or 14 days (not a bad idea though), the nearest it can get is:

[CODE]ofexport -a "due='today to next fri'" -a prune | more
ofexport -a "due='today to 2013-07-08'" -a prune | more[/CODE]

The reason I've used -a instead of -t here as that the latter applies only to tasks, whereas the former applies to anything applicable (projects and tasks). I'm guessing you'd want to see tasks without a due date that are in a project with a due date.

Athmet 2013-07-01 11:51 AM

First, thanks for making this. I've been looking for something like this for a while.

Second, I'm having an issue getting all this working with Hazel. I have the script to run, which looks like this:

[CODE]#!/bin/bash

FILE=/Users/XXXXXX/Dropbox/Public/report.txt

. /Users/XXXXXX/.bashrc
ofexport -p 'name="Home Projects"' --tasks -t done=none -T flat -o "$FILE"[/CODE]

It works when I activate it myself, but hazel doesn't see to want to make it work.

I'm a bit of a noob with command line and scripting, but I learn fast. Any suggestions?

Athmet 2013-07-01 12:09 PM

Just to give all the info I can, the script in Hazel is:

[CODE]. /Users/athmet/.bashrc
/Users/athmet/Dropbox/public/of_statusboard[/CODE]

Helps to have all the info I guess.

psidnell 2013-07-01 09:39 PM

[QUOTE=Athmet;125854]Just to give all the info I can, the script in Hazel is:

[CODE]. /Users/athmet/.bashrc
/Users/athmet/Dropbox/public/of_statusboard[/CODE]

Helps to have all the info I guess.[/QUOTE]

I had similar issues, [URL="https://github.com/psidnell/ofexport/blob/master/documentation/Hazel.md"]does this help[/URL]?

23dex 2013-07-25 09:18 AM

does ofexport work with OF 2?
 
Thanks again, psidnell! I have something working now that does a daily export that emails me with upcoming things. My script is truly lame, but it works ok.

I just got invited into the OF2 beta, after having signed up on the site a few months ago. I seem to remember that ofexport could have issues if the OF schema changes in the sqllite database. Have you gotten a chance to test ofexport with OF 2? I wouldn't be surprised if OF2 introduces some schema changes.

RobTrew 2013-07-25 11:54 AM

[QUOTE=23dex;126459]I just got invited into the OF2 beta, after having signed up on the site a few months ago. I seem to remember that ofexport could have issues if the OF schema changes in the sqllite database. Have you gotten a chance to test ofexport with OF 2? I wouldn't be surprised if OF2 introduces some schema changes.[/QUOTE]

I think your scripting should serve you well for a while no immediate prospect of changes to the sqlite schema. OF2 will essentially be a new skin around vintage wine. There may be some Applescript changes to the UI level, but the table and field structure haven't changed.

In addition, the first draft of the beta (the one that can be downloaded) was a very preliminary and experimental sketch, not a full implementation even of existing OF1 functionality you probably won't find yourself using it regularly, and even the visual level of it now being revised, to make sure that it promotes the user content more than itself, and majors more on good information design than on decorative upholstery and visual allusion.

psidnell 2013-07-25 11:24 PM

[QUOTE=23dex;126459]I just got invited into the OF2 beta, after having signed up on the site a few months ago. I seem to remember that ofexport could have issues if the OF schema changes in the sqllite database. Have you gotten a chance to test ofexport with OF 2? I wouldn't be surprised if OF2 introduces some schema changes.[/QUOTE]

I never tried it out myself, but other people did and gave me a patch for the DB location. Nobody reported any problems, but that's all I know at the moment.

As Rob said, currently OF2 is very preliminary - I was going to wait until it's much nearer release and stabilised before dealing with any issues.

23dex 2013-07-28 09:12 AM

Thanks Rob and Paul for the info. If OF2 is still changing a fair amount maybe I'll go ahead and wait for a bit to test it out.

Thanks! And thanks to both of you for the tools you've created for use with OF!


All times are GMT -8. The time now is 06:03 AM.

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