Skip to content

Instantly share code, notes, and snippets.

@brandonpittman
Last active April 9, 2016 03:03
Show Gist options
  • Save brandonpittman/590da7f21729b00f11e3 to your computer and use it in GitHub Desktop.
Save brandonpittman/590da7f21729b00f11e3 to your computer and use it in GitHub Desktop.
Complete a task in OmniFocus and open the URL in the note
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
};
})
@brandonpittman
Copy link
Author

Is anyone having trouble with the system calls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment