Script Help - Editing Album Art

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

fenrir
Posts: 35
Joined: Tue Feb 12, 2008 12:05 pm

Script Help - Editing Album Art

Post by fenrir »

How do i access the Cover ?

Code: Select all

   	
With SDB.Player.CurrentSong
        .Covers = GetImageFromClipboard
        .UpdateDB
        .WriteTags
End With
.Covers = GetImageFromClipboard //// .Covers is wrong here.. any idea what it should be?

I'm trying to write the current image on the clipboard to the song's album art
Last edited by fenrir on Tue Apr 01, 2008 3:57 am, edited 1 time in total.
fenrir
Posts: 35
Joined: Tue Feb 12, 2008 12:05 pm

Post by fenrir »

Nevermind. Got it

.AlbumArt
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Yeah, AlbumArt is what you're after. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
fenrir
Posts: 35
Joined: Tue Feb 12, 2008 12:05 pm

Post by fenrir »

Umm.. another help..
SDBAlbumArtItem does not allow to set an Image property..

Any idea how to add an art to the AlbumArt tag?

I would rather not create an image at the temp location and then add it via PicturePath, as far as possible ie.
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

I think you need to have a physical file, unfortunately. Personally I've found this method best...

Code: Select all

Set img = itm.AlbumArt.AddNew            
img.RelativePicturePath = relpath(newpath,itm.Path)
img.ItemType = 3
img.ItemStorage = 0
Where "relpath" is...

Code: Select all

Function relpath(relp,path)
  relpath = relp
  Dim temp : temp = Left(path,InStrRev(path,"\"))
 
  'check same folder
  If InStr(relp,temp) = 1 Then
    relpath = Mid(relp,Len(temp)+1)
    Exit Function
  End If
 
  'check parent folders
  If Left(temp,2) = "\\" Then
    temp = Mid(temp,3)
  End If
  If Left(relp,2) = "\\" Then
    relp = Mid(relp,3)
  End If
  Dim tp : tp = Left(temp,InStr(temp,"\"))
  Dim tr : tr = Left(relp,InStr(relp,"\"))
  If (UCase(tp) = UCase(tr)) Then
    While (UCase(tp) = UCase(tr))
      temp = Mid(temp,Len(tp)+1)
      relp = Mid(relp,Len(tr)+1)
      tp = Left(temp,InStr(temp,"\"))
      tr = Left(relp,InStr(relp,"\"))
    WEnd
    relpath = ""
    While (InStr(temp,"\") > 0)
      relpath = relpath&"..\"
      temp = Mid(temp,Len(tp)+1)
      tp = Left(temp,InStr(temp,"\"))
    WEnd
    relpath = relpath&relp
  End If
End Function
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
fenrir
Posts: 35
Joined: Tue Feb 12, 2008 12:05 pm

Post by fenrir »

thank u so much..

i'd give it a go..
Basically modifying WebSearch Panels script to add more buttons other than the default Lyrics & Comment button.

Thinking of adding a button for as many Tags as possible. Have all of them working (with the clean up text) except for the AlbumArt part.

Hope jn does not mind
trixmoto
Posts: 10024
Joined: Fri Aug 26, 2005 3:28 am
Location: Hull, UK
Contact:

Post by trixmoto »

Sounds like a good idea - I'm sure he won't mind as long as you mention the fact that it's a modification of his script. Maybe send him a PM first to see what he thinks. :)
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
Post Reply