Created
January 24, 2013 18:17
-
-
Save darkwookiee/4625974 to your computer and use it in GitHub Desktop.
This Script run in pythonista on iOS. It take a plain liste, in the clipboard, and for each item in the list, create a task in Omnifocus.
This ia not optimal, since Omnifocus doesn'n seem to provide a x-callback-url. Pythonista need to be reopen each time.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Import into Omnifocus a list of task from the clipboard | |
import clipboard | |
import re | |
import webbrowser | |
import urllib | |
import console | |
base = 'omnifocus:///add?name=' | |
text = clipboard.get() | |
if text == '': | |
print 'No text in clipboard' | |
else: | |
lines = text.split('\n') | |
filtered = filter(lambda x: not re.match(r'^\s*$', x), lines) | |
for line in filtered: | |
if (line <> '\n'): | |
omniurl = urllib.quote(line) | |
webbrowser.open(base+omniurl) | |
console.alert("Import","Import Next in Omnifocus ?","Yep") | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment