Created
October 14, 2013 02:29
-
-
Save pdxmph/6969791 to your computer and use it in GitHub Desktop.
Get the current 'net radio track info from iTunes, make it a todo in Things
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 | |
| require "rubygems" | |
| require "appscript" | |
| include Appscript | |
| itunes = app("iTunes") | |
| things = app("Things") | |
| list = "Things to Look Up" | |
| project = things.projects[list] | |
| todos = things.to_dos | |
| track = itunes.current_stream_title.get | |
| url = itunes.current_stream_URL.get | |
| source = itunes.current_track.name.get | |
| unless todos[its.name.eq(track)].get.length > 0 | |
| task = things.make(:at => project.beginning, :new => :to_do, :with_properties => { | |
| :name => track, | |
| :tag_names => "music,#{source}", | |
| :notes => "Heard on [url=#{url}]#{source}[/url] at #{Time.now}" | |
| }) | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment