Created
December 16, 2011 03:20
-
-
Save monsieuroeuf/1484286 to your computer and use it in GitHub Desktop.
Make a new To Do in Things, based on the name and URL of the currently selected item in NetNewsWire.
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
#!/usr/bin/env ruby | |
# coding: utf-8 | |
# Ian Haigh - thejoyofappscript.com | |
# Make a new To Do in Things, based on the name and URL of the currently | |
# selected item in NetNewsWire. The new To Do goes slap bang into the "Someday" | |
# category. Handy for temporary bookmarks for things that you want to check | |
# out later but aren't suitable for Instapaper, like video. | |
# Based on this script by Mike Hall: | |
# http://mph.puddingbowl.org/2010/07/creating-links-in-the-body-of-a-note-in-things/ | |
TAGS = "nnw, watch" | |
# tags that get added to the new To Do | |
def create_to_do(name, source, link) | |
if link == "" | |
note = name | |
else | |
note = "[url=#{link}]#{name} - #{source}[/url]" | |
end | |
task = @things.make(:at => app.lists["Someday"].beginning, :new => :to_do, :with_properties => { | |
:name => "#{source} – #{name}", | |
:tag_names => TAGS, | |
:notes => note, | |
}) | |
end | |
require 'rubygems' | |
require 'appscript' | |
include Appscript | |
nnw = app("NetNewsWire") | |
@things = app("Things") | |
name = nnw.selectedHeadline.title.get | |
link = nnw.selectedHeadline.URL.get | |
source = nnw.selectedHeadline.subscription.givenName.get | |
create_to_do(name, source, link) | |
#`growlnotify -p 1 -m "Added \"#{name}\" to things."` | |
# uncomment the previous line if you've got Growl installed | |
# and you want a pretty message to pop up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment