Last active
April 9, 2016 03:03
-
-
Save brandonpittman/590da7f21729b00f11e3 to your computer and use it in GitHub Desktop.
Complete a task in OmniFocus and open the URL in the note
This file contains hidden or 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
of = Library('Omnifocus') | |
sel = of.selected() | |
app = Application('OmniFocus') | |
app.includeStandardAdditions = true | |
system = Application.currentApplication() | |
system.includeStandardAdditions = true | |
sel.forEach(function(task) { | |
of.complete([task]) | |
name = task.name() | |
note = task.note() | |
quote = '"' | |
urlRegExp = new RegExp('://') | |
if (note.match(urlRegExp)) { | |
console.log(note) | |
system.doShellScript("open " + quote + note + quote) | |
return true | |
}; | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is anyone having trouble with the system calls?