(* 


Now Playing in Adium with mpd v1.0

by Marko Vihoma

http://personal.inet.fi/koti/marko.vihoma/



Based on Now Playing in Adium v1.0

written by Adam Nolley


Get more free AppleScripts for iTunes and

help writing your own:

http://www.malcolmadams.com/itunes/


*)


-- on run is just for testing with Script Editor or osascript commandline tool

on run

set x to my substitute()

display dialog ((count x) as Unicode text) & ": " & x as Unicode text

end run


on substitute()

set output to fig_tags()

returndata utxt266B0020» as Unicode text) & output

end substitute



to fig_tags()

-- initialize; used as two parts of status message

set {nom, art} to {"", ""}

-- Change the below two script paths to the paths to the two shell scripts needed and available from my homepage.

set nom to do shell script ("/Users/marko/bin/np_mpc_adium_2" as Unicode text)

set art to do shell script ("/Users/marko/bin/np_mpc_adium_1" as Unicode text)

if art is not "" and nom is not "" then

set myMessage to art & " - " & nom

else if nom is not "" then

set myMessage to nom

else if art is not "" then

set myMessage to art

else

set myMessage to "ei mittään :("

end if

return myMessage

end fig_tags