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

 
Simple, highly portable python script for Command-line inbox tasks Thread Tools Search this Thread Display Modes
I've been using OmniFocus for many years now, but recently lost my primary input (broken phone), so I needed an easy way to collect tasks for processing on my iPad(s).
Since I've got a web dav running on my hostgator account, I wrote a simple script to just push things to the inbox via email.

This python script should work out of the box for any 2.6-2.7 python installation. The only extra file I use is Evan Fosmacks filelock.py. The advantage here is that this is very portable, and most other scripts require OmniFocus is installed. There is risk as updates or edge cases could cause issues. Use at your own risk!

Just unzip this into the directory that OmniFocus.ofocus lives and set up your exim filter or procmail filter to pipe emails into the script.

For example, hostgator uses exim, so I set up an email account at SOME_EMAIL_ADDRESS, and modified the exim filter script (located at /etc/vfilters/MY_DOMAIN_NAME.com) to include:

Code:
#taskToOmnifocus
if
 $header_to: matches "SOME_EMAIL_ADDRESS"
then
 pipe "python /PATH_TO_SCRIPT/addTask.py"
endif
Now when I send an email to SOME_EMAIL_ADDRESS@MY_DOMAIN_NAME.com it will read every non-empty line in the body of the email and create separate inbox tasks. Remember to delete sigs before sending the email.

Alternatively you can use this as a commandline script, just run
Code:
python addTask.py "Some new task" "Another new task"
I didn't want any bells and whistles since I like to collect directly into my inbox and add contexts/etc when processing, but it is very simple to add extra stuff if you are so inclined.

Please back up your omnifocus database before running this - I have not encountered any problems but I am not responsible for anything going pear shaped.

One question for the Omni guys - what does rank do? I take the highest rank value and increment it, but it seems like multiple things can have the same rank. I wasn't sure what good that value does.
Attached Files
File Type: zip AddToInbox.zip (4.3 KB, 282 views)
 
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes



All times are GMT -8. The time now is 10:14 PM.


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