![]() You should probably backup your OmniFocus data before playing with this. Ultimately, the program sends OmniFocus a series of commands asking it to modify your task lists, so it's perfectly possible that things will get trashed! I've used this program myself and it appears to work, but you should be aware that I know very little Ruby and even less AppleScript. T = dd.make(:new => :inbox_task, :with_properties => tprops) Feel free to steal it for your own applications. Simplified slightly in the interests of clarity, the basic core is shown below. % of-import-yaml -output YAML tasks.yml Internals To run it, you probably want something like this: % of-import-yaml -help You can download the program, 5 but you'll then need to copy it to somewhere on your PATH. You'll probably generate the YAML with another program, but here's the sort of thing you should get:. Exists here just means that there's already a task with the same name in that project.įinally you can ask the program to dump a list of all the tasks it actually added. _no_dupes : If true, don't import the task if it already exists.Some of these are interpreted by the program: Incoming fields beginning with an underscore aren't passed to the AppleScript API, rather they're understood as being 'internal' to the import process. To find the relevant project I do a global name search: this means that the project name should probably be unique! The project name should be passed as an object reference, not a string.Dates need special handling because AppleScript wants a date object not a string.People who are better at AppleScript than I could probably take this a step further in automating the copy-paste step. It’s also not hard to add a Launchd configuration to run this script each December so I can make sure the schedule is in place for the coming year. In most cases it's just a case of passing strings around, but there are three exceptions: Adding the project to OmniFocus is as easy as copy-pasting the text. It takes data from a YAML 4 file, treats them as simple task properties, and calls the relevant API. The program tries to do as little work as possible. The dictionary is particularly handy for details about the properties supported by each task. Andy Schott's examples 3 were helpful, as was browsing the OmniFocus dictionary with the AppleScript Editor application (File | Open Dictionary). Happily there are a number of OmniFocus AppleScript examples floating around the web. I've not written much Ruby, but how hard can it be ? Discussion Sadly the Perl interface seems a bit flakey and unloved, perhaps because the cool guys seem to use Ruby's rb_appscript 2 for this sort of thing. So, I'd rather use a mainstream language with AppleScript bindings. In practice though I know very little AppleScript, and when I've tried to write command line scripts with it before, it's always been a pain. ![]() Happily, the Mac application has a rich AppleScript API, so in principle one could use this to solve the task. However, somewhat inexplicably, it's hard to import a list of tasks generated elsewhere into OmniFocus. It runs on the Mac, iPad and iPhone, and I simply wouldn't be without it. OmniFocus 1 is a wonderful task management application.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |