Skip to content

Instantly share code, notes, and snippets.

@mygeekdaddy
Forked from darkwookiee/SendListToOmni.py
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mygeekdaddy/b413b559249c63bf3997 to your computer and use it in GitHub Desktop.
Save mygeekdaddy/b413b559249c63bf3997 to your computer and use it in GitHub Desktop.
#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