/ Published in: Ruby
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/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 at [url=#{url}]#{source}[/url]" }) end