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

 
Export from the command line or AppleScript for specific contexts/projects? Thread Tools Search this Thread Display Modes
Hi,

I want to export the due-today tasks of a particular project/context to a plain text file for digestion by other tools. Can this be done from the command line or can Anyone point Me in the direction of information of how to do this in AppleScript? (I've looked at other AppleScripts but, due to My limited knowledge of the language, I am not exactly sure if they are for what I am looking.)

Thanks.
 
Quote:
Originally Posted by xuinkrbin. View Post
I want to export the due-today tasks of a particular project/context to a plain text file for digestion by other tools. Can this be done from the command line
One approach would be to use something like my QueryOF2Text script (attached below) which is a draft command-line version of Where In OF.

You can use it from the shell prompt in the OS X terminal like this:

Code:
osascript ~/Library/Scripts/Applications/Omnifocus/queryof2text.scpt 'tasks where ("library" is in name of its context) and (due date < now)' > listA.txt
or
Code:
osascript ~/Library/Scripts/Applications/Omnifocus/queryof2text.scpt 'tasks where ("write" is in name of its containing project) and (due date < now)' > listB.txt
where osascript calls the script in the specified path, and gives it the query (NB: in single quotes) as an argument, sending the output lines into the named text file.

The query syntax is essentially that of an Applescript WHOSE / WHERE clause,
(The query should begin with the words "where"/"whose" and folders/ projects / tasks / contexts)
There are currently a few minor extensions to the applescript query language:
  1. Searches may be prefixed by the term 'archived'
  2. The terms today/yesterday/tomorrow/soon/now may be used in place of dates. 'today' (but no other expressions) may be modulated with interval strings: today + 2d, today - 1w, today +2m, today +1y
    ('now' is the current system time, 'today' is 00:00 hours this morning)
  3. symbols in the range <jan> to <dec> are interpreted as 00:00 hours at the start of the next (or current) month of that name
  4. you can query on the properties of repetition and location records (this is not possible in raw applescript filters)

It would probably make sense to begin by experimenting with Where in OF? (http://bit.ly/OF-Find2) to get the query right.

Where in OF contains a simple property browser, with which you can start to explore the query language from which filters can be built.

--

Last edited by RobTrew; 2012-07-17 at 06:53 AM..
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up a perspective with specific contexts and specific projects mikegibb Applying OmniFocus 3 2012-02-10 01:20 PM
Exporting omnigraffle canvases to PDF,SVG,PNG,EPS from command line fikovnik OmniGraffle General 2 2011-06-13 05:28 AM
Selecting 003 rows with 'command-line' queries RobTrew OmniOutliner 3 for Mac 1 2010-07-08 01:46 AM
Redirecting command line output into OO ptorngaard OmniOutliner 3 for Mac 3 2009-04-05 11:29 PM
Create new search through command line m-rick OmniWeb General 1 2007-03-19 03:27 PM


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


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