adric: (Mac OS X)
Check out this: "RubyOSA: The End of AppleScript?" http://www.clarkware.com/cgi/blosxom/2006/10/24#RubyOSA
which links to: "Rake Shame" http://codefluency.com/2006/10/23/rake-shame
and from which I scrawled song.rb:
require '~/Work/rubyosa/osa.bundle'
require '~/Work/rubyosa/rbosa.rb'

itunes = OSA.app('itunes')
track = itunes.current_track

p track.artist + " - " + track.name
With which and a dash of alias song="ruby ~/Work/song.rb" I now have a song command for posting to LJ:
song | pbcopy ... complete with Unicode escapes that no one likes, apparently...
and this with some inevitability leads to:
tunes = OSA.app('itunes')
ducktroller = OSA.app('adium').adium_controller
ducktroller.my_status_message= tunes.current_track.artist + " - " + tunes.current_track.name
.. which I'll shortly thrown in cron..

Profile

adric: books icon (c) 2004 adric.net (Default)
adric

November 2025

S M T W T F S
      1
2345678
9101112131415
16171819202122
23242526 2728 29
30      

Links

Syndicate

RSS Atom

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated 9 January 2026 08:00 pm
Powered by Dreamwidth Studios