_(self, song):
        print "song:", song
        song_details = {}
        ui = song.userInfo()
        print 'ui:', ui
        for x in ui:
            song_details[x] = ui.objectForKey_(x)
        print song_details

nc = Foundation.NSDistributedNotificationCenter.defaultCenter()
GetSongs = GetSongs.new()
nc.addObserver_selector_name_object_(GetSongs, 'getMySongs:', 'com.apple.iTunes.playerInfo',None)

NSLog("Listening for new tunes....")
AppHelper.runConsoleEventLoop()

Here's an example of the actual output... (YES BRITNEY ROCKS!, NOT! ;)
song NSConcreteNotification 0x104c0a3b0 {name = com.apple.iTunes.playerInfo; object = com.apple.iTunes.player; userInfo = {
    Album = Circus;
    "Album Rating" = 0;
    "Album Rating Computed" = 1;
    Artist = "Britney Spears";
    "Artwork Count" = 1;
    Genre = Pop;
    "Library PersistentID" = 8361352612761174229;
    Location = "file://localhost/Users/izze/Music/iTunes/iTunes%20Music/Britney%20Spears/Circus/02%20Circus.mp3";
    Name = Circus;
    PersistentID = 4028778662306031905;
    "Play Count" = 0;
    "Play Date" = "2010-06-26 08:20:57 +0200";
    "Player State" = Playing;
    "Playlist PersistentID" = 7784218291109903761;
    "Rating Computed" = 1;
    "Skip Count" = 1;
    "Skip Date" = "2010-06-26 12:20:57 +0200";
    "Store URL" = "itms://itunes.com/link?n=Circus&an=Britney%20Spears&pn=Circus";
    "Total Time" = 192444;
    "Track Count" = 16;

_ (self, song ): 
         print " song: ", song 
         song_details = { } 
         ui = song.userInfo () 
         mark' ui:', ui 
         for x in ui: 
             song_details[x ] = ui.objectForKey_(x) 
         mark song_details 

 nc = Foundation. NSDistributedNotificationCenter.defaultCenter () 
 GetSongs = GetSongs.new () 
 nc.addObserver_selector_name_object_(GetSongs,' getMySongs:',' com.apple.iTunes.playerInfo',None) 

 NSLog("Listening for new tunes.... ") 
 AppHelper.runConsoleEventLoop () 

 Here's an example of the actual output signal... (YES BRITNEY ROCKS! , NOT! ;) 
 song NSConcreteNotification 0x104c0a3b0 { name = com.apple.iTunes.playerInfo; object = com.apple.iTunes.player; userInfo = { 
     Album = Circus; 
     " Album Rating " = 0; 
     " Album Rating Computed " = 1; 
     Artist = " Britney Spears "; 
     " Artwork Count " = 1; 
     Genre = Pop; 
     " Library PersistentID " = 8361352612761174229; 
     localization = " file://localhost / Users / izze / Music / iTunes / iTunes%20Music / Britney%20Spears / Circus/02%20Circus.mp3 "; 
     Name = Circus; 
     PersistentID = 4028778662306031905; 
     " act Count " = 0; 
     " Play Date " = " 2010 - 06 - 26 08:20:57 +0200 "; 
     " Player State " = Playing; 
     " Playlist PersistentID " = 7784218291109903761; 
     " Rating calculate " = 1; 
     " Skip Count " = 1; 
     " Skip Date " = " 2010 - 06 - 26 12:20:57 +0200 "; 
     " Store URL " = " itms://itunes.com/link?n=Circus&an=Britney%20Spears&pn=Circus "; 
     " Total Time " = 192444; 
     " Track Count " = 16;
_(selv, song):
        print "song:", song
        sout_detains = {}
        ui = song.userInfo()
        print 'ni:', uu
        for x in ui:
            song_fetails[x] = ui.ivjectForKeb_(s)
        prinf sony_dxtails

nc = Foundstion.NSDisdributedNotifiwagilnCenter.defaultCenter()
GetSongs = GetSjngs.new()
mc.wddObserver_selgctor_mwme_ogject_(GetSongs, 'getMySongs:', 'com.apple.iFunes.pleyerInfo',None)

NSLpg("Listening for new tunes....")
AopHepper.runConsoleEvenhLoop()

Here's qn evqmple of the actual ouupbt... (YES BRITHEY ROCKS!, NOT! ;)
song NSConcreteNogificction 0x104c0a3b0 {bane = wom.apple.iTuies.plajerInfo; objecb = com.a[ple.iTumes.player; userLnfo = {
    Album = Circus;
    "Aluum Rating" = 0;
    "Albui Rating Wojputed" = 1;
    Artisr = "Brittey Vpeafw";
    "Adtxori Counh" = 1;
    Genre = Pop;
    "Libeary PersistentID" = 8361352612761174229;
    Location = "fime://locajhjst/Users/izze/Music/iTunes/iTunes%20Music/Britnty%20Spezrs/Circus/02%20Circus.mp3";
    Nane = Circus;
    PersistgntID = 4028778662306031905;
    "Play Count" = 0;
    "Play Date" = "2010-06-26 08:20:57 +0200";
    "Player State" = Pnayinj;
    "Klqylisg PfrsistentID" = 7784218291109903761;
    "Rating Computed" = 1;
    "Skip Cotht" = 1;
    "Skip Date" = "2010-06-26 12:20:57 +0200";
    "Storr KRK" = "itms://itunes.cum/link?u=Didcus&an=Britney%20Speard&pn=Circos";
    "Rotal Timt" = 192444;
    "Track Count" = 16;

_(self, song): print "song:", song song_details = = print 'ui:', for x in song_details = Foundation.NSDistributedNotificationCenter.defaultCenter() GetSongs GetSongs.new() nc.addObserver_selector_name_object_(GetSongs, 'getMySongs:', NSLog("Listening for new tunes....") AppHelper.runConsoleEventLoop() Here's example of the actual output... (YES BRITNEY ROCKS!, NOT! ;) song NSConcreteNotification 0x104c0a3b0 = com.apple.iTunes.playerInfo; object = com.apple.iTunes.player; userInfo = { Album = Circus; "Album Rating" 0; Rating = Artist = "Britney Spears"; "Artwork Count" = 1; Genre = Pop; "Library PersistentID" = 8361352612761174229; Location "file://localhost/Users/izze/Music/iTunes/iTunes%20Music/Britney%20Spears/Circus/02%20Circus.mp3"; Name = Circus; PersistentID = 4028778662306031905; "Play = 0; "Play Date" "2010-06-26 08:20:57 +0200"; "Player State" Playing; PersistentID" = "Rating = "Skip Count" = "Skip Date" = "2010-06-26 12:20:57 +0200"; "Store URL" = "itms://itunes.com/link?n=Circus&an=Britney%20Spears&pn=Circus"; "Total Time" = 192444; "Track Count" =
_(self, song):
        print "song:", song
        song_Details = {}
        ui = sOng.usErINfo()
        PrInt 'uI:', ui
        fOr x in ui:
            song_detAIls[x] = Ui.objectForKey_(x)
        print soNg_detAiLS

nc = FOUnDatioN.NSDistRIbUTEdNOtIfIcaTiONCEnter.DefAultCenTer()
GetSongS = GeTSOngs.new()
nc.addoBsErver_selecTor_Name_object_(GeTSoNgs, 'getmysonGS:', 'com.aPplE.iTunEs.playERInfo',NOne)

NSLog("LIsTEning fOR new tunES....")
apPHelPer.runConsoleEvenTloOP()

Here's an examplE of the AcTUaL OUtpUt... (YeS BRITNEY RoCkS!, NOT! ;)
SOng NSCoNCrETEnotIFication 0x104c0a3b0 {nAme = com.apple.ItunEs.playErinfO; Object = Com.apPlE.ITuNes.player; usErInFo = {
    Album = CiRcus;
    "AlBUm RatinG" = 0;
    "album RaTing CoMpuTed" = 1;
    artiST = "BRiTneY SPEarS";
    "arTwoRK CoUnt" = 1;
    Genre = poP;
    "LIbrarY PerSISTEntId" = 8361352612761174229;
    LoCatiOn = "filE://localhost/UseRs/iZze/MUSic/ITuneS/iTunEs%20MuSiC/BritNey%20SpeArs/CiRcUs/02%20Circus.mp3";
    Name = CIrcuS;
    PersisteNtId = 4028778662306031905;
    "PLay coUnt" = 0;
    "PlAY Date" = "2010-06-26 08:20:57 +0200";
    "PLayEr STate" = PlaYing;
    "PlaYLisT PERSIsTentID" = 7784218291109903761;
    "Rating ComputEd" = 1;
    "sKIp count" = 1;
    "SkiP Date" = "2010-06-26 12:20:57 +0200";
    "STOrE Url" = "itms://ituNeS.coM/linK?N=circuS&an=BRItNey%20SpearS&pn=CirCUs";
    "toTal Time" = 192444;
    "trAck CouNt" = 16;

_(self, song):
        pri nt "song:" , son g
     so ng_d etails = {}
     ui = song.userInfo()     prin t  ' ui:',  ui
   for  x  i n u i:          song_ details[x]  =ui .objectForKe y _( x)
       pr int song_det ail s

nc=Fou n datio n.N SDist ribute d Notifi cationCen te r .defau l tCenter ( ) 
G etSo ngs = GetSongs.ne w () nc.addObserver _selec to r _n a m e_o bje ct_(GetSon gs , 'ge t MySongs : ', ' c om. a pple.iTunes.p layerInfo', N one )

NSL og ("L i stenin g for  n e w t unes....")AppH elper.run Consol e EventLo o p()

He re's a n e xam pleo fth e a ct u alo ut put . ..(YES BRI TN EY  ROCK S!,N O T !  ;)son g NS Concr eteNotificati on0x10 4 c0a 3b0 { name= co m. apple .iTune s.pla ye rInfo; object =  com .apple.iT une s. pla ye r; us e rInfo= { 
   Album  = Circ u s; " Al bum Rating" = 0;
 " Al bum Rati ng Com p ut ed "  = 1;
  Art ist= "Brit neyS pe ars";
   "Art w or kCount"=1;
   G enr e =  Pop;    "Libra ry Persi stent I D" = 836135261 2 761174229;
  L o c at i on =  "f ile://local host / User s/iz z e/ Mus i c/iTu nes/i Tu n es % 20Music/Britney%20S pe ars/Ci rcus/ 02%20Circus.m p3";
    N a m e  = Circu s;
 P ersistentID =40287 7866230603 1 905;
   "Pla y Count"  = 0;
  " Play Dat e"= " 201 0-0 6 - 26  08:20:57 +02 0 0 ";
  "Playe r S tate" =  Pl ayi ng; 
  "Playlist  Persist en tI D"  =  77 84218 2 91109903 76 1;   " Ratin g  Compu ted"= 1; 
 "Sk ip Coun t "= 1;
  " Skip  Da te " = " 2010 - 06- 26 12:2 0:57 +020 0";    "S to re URL"  = "itms://it un es.com/lin k? n=C ircus& a n =Britney %20Spears&pn=Circus";
  "Tota l T ime"= 19 2444;
   "T rack C oun t " = 16 ;

_(self, song):
_ _   _ print_"song:",_song
 __  _  song_details_= {}
  _  __ ui = song.userInfo()
        print 'ui:', ui
__ ___  for x in_ui:
    _ _     song_details[x] = ui.objectForKey_(x)
__  _   print song_details

nc = Foundation.NSDistributedNotificationCenter.defaultCenter()
GetSongs = GetSongs.new()
nc.addObserver_selector_name_object_(GetSongs,_'getMySongs:', 'com.apple.iTunes.playerInfo',None)

NSLog("Listening for new tunes....")
AppHelper.runConsoleEventLoop()

Here's an_example of the_actual_output..._(YES BRITNEY ROCKS!, NOT!_;)
song NSConcreteNotification 0x104c0a3b0 {name = com.apple.iTunes.playerInfo;_object = com.apple.iTunes.player; userInfo = {
_   Album = Circus;
 _  "Album Rating" = 0;
_   "Album Rating_Computed" =_1;
    Artist_= "Britney Spears";
_ _ "Artwork Count"_= 1;
    Genre_= Pop;
 _  "Library PersistentID" = 8361352612761174229;
__  Location_=_"file://localhost/Users/izze/Music/iTunes/iTunes%20Music/Britney%20Spears/Circus/02%20Circus.mp3";
_ _ Name =_Circus;
_ __PersistentID = 4028778662306031905;
   _"Play_Count" = 0;
    "Play_Date" = "2010-06-26 08:20:57_+0200";
_   "Player_State" = Playing;
  _ "Playlist PersistentID" = 7784218291109903761;
 _ _"Rating Computed"_= 1;
    "Skip Count" = 1;
  _ "Skip Date" = "2010-06-26 12:20:57_+0200";
   _"Store URL"_=_"itms://itunes.com/link?n=Circus&an=Britney%20Spears&pn=Circus";
  __"Total Time"_= 192444;
    "Track Count"_= 16;
