14 Nov

Send article to OmniFocus - AppleScript

Wednesday November 14th 2007, 3:07 pm
Tags: , ,

The last missing link in my OmniFocus workflow: Vienna article reading reminder.


property actionPrefix : "Read "

tell application "Vienna"
tell current article
set theURL to link
set theName to title
end tell
end tell

tell front document of application "OmniFocus"
tell quick entry
make new inbox task with properties {name:(actionPrefix & theName), note:theURL}
activate
select {inbox task 1}
end tell
end tell

Download: send-article-to-omnifocus.scpt

3 Comments

05 Oct

OmniFocus Inbox Notifier

Friday October 05th 2007, 10:47 pm
Tags: , , ,

With Matt Neuburg’s AppleScript book I slowly get a grip of the language. Here is a small script to check for forgotten (i.e. older than a day) Inbox tasks in OmniFocus and show a Growl notification if there are some:

on notify(theDescription)
tell application "GrowlHelperApp"
set the allNotificationsList to {"Inbox not empty"}
set the enabledNotificationsList to {"Inbox not empty"}

register as application ¬
"OmniFocus Inbox Notifier" all notifications allNotificationsList ¬
default notifications enabledNotificationsList ¬
icon of application "OmniFocus"

notify with name ¬
"Inbox not empty" title ¬
"Inbox not empty" description ¬
theDescription application name "OmniFocus Inbox Notifier" with sticky
end tell
end notify

tell front document of application "OmniFocus"
set oldTasks to inbox tasks whose its creation date < (current date) - 100 -- 3600 * 24
set inboxCount to count of oldTasks
if inboxCount > 0 then
if inboxCount > 1 then
my notify((inboxCount as string) & ” tasks are waiting.”)
else
my notify((inboxCount as string) & ” task is waiting.”)
end if
end if
end tell

Runnable with an iCal event which repeats once a day, or via an osascript call from cron.

0 Comments