I had a half built code, I've edited it a bit more and this is more reliable. Just a simple solution, but at least a solution, and works absolutely great with me!
code:
//Music DP by can16358p
//Make your Display Picture the cover of the album of the song you are listening to!
//Edit the path to your My Music folder
//For any reason, if another filename is used for album arts instead of folder.jpg, change it there
//Tested with Windows Media Player 11, but should work with any configuration that has the songs and the album art file in My Music/Artist/Album/
//Do anything you want with this code. Play with it, change things in it.
var initial="";
var path="D:/Documents/My Music/";
var imgfile="";
var imgname="folder.jpg";
var name="";
var artist="";
var album="";
var id="";
var existcheck=new ActiveXObject("Scripting.FileSystemObject");
var sinfo="<ScriptMenu>"
sinfo+="<MenuEntry Id=\"mddp\">Make current DP default</MenuEntry> ";
sinfo+="</ScriptMenu>";
function OnEvent_Initialize(MessengerStart){
initial=Messenger.MyDisplayPicture;
Debug.trace("Script Started!");
Debug.trace("Default DP: "+initial);
}
function OnEvent_MenuClicked(id,loc,orig){
if(id=="mddp"){
initial=Messenger.MyDisplayPicture;
Debug.trace("Default DP Updated.");
Debug.trace("Default DP: "+initial); }
}
function OnGetScriptMenu(loc){
return sinfo;
}
function OnEvent_Signin(mailaddrr){
var initial=Messenger.MyDisplayPicture;
Debug.trace("Initial Image is: "+initial);
if(Messenger.MyStatus>=3){
makedp(Messenger.MyCurrentMedia);
}
}
function OnEvent_Uninitialize(MessengerExit)
{
Messenger.MyDisplayPicture=initial;
}
function OnEvent_MyMediaChange(newsong){
makedp(newsong);
}
function makedp(str){
str=str.substring(str.indexOf("{1}\\0")+5);
song=str.substring(0,str.indexOf("\\0"));
str=str.substring(str.indexOf("\\0")+2);
artist=str.substring(0,str.indexOf("\\0"));
str=str.substring(str.indexOf("\\0")+2);
album=str.substring(0,str.indexOf("\\0"));
str=str.substring(str.indexOf("\\0")+2);
id=str.substring(0,str.indexOf("\\0"));
str=str.substring(str.indexOf("\\0")+2);
imgfile=path+artist+"/"+album+"/"+imgname;
if(existcheck.FileExists(imgfile) && song!=""){
Debug.trace("Artist: "+artist+", Song: "+song+", Album: "+album);
Messenger.MyDisplayPicture=path+artist+"/"+album+"/"+imgname;
}else{
Debug.trace("File not found! Changing DP to "+initial);
Messenger.MyDisplayPicture=initial;
}
}