Custom field update script

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Custom field update script

Re: Custom field update script

by JohnnyTaylor » Wed Feb 03, 2021 2:14 am

Hi, pavan, I want to say thank you for asking for the code, actually, I was also searching for the same. I am also new to this language and using this in a jumble solver code that is required for word games.

by trixmoto » Mon Jan 23, 2006 10:50 am

Yeah, almost everyday I use Uniface, VBScript and Delphi - I tend to get lots of compilation errors because I'm mixing my syntaxes! :)

by Paven » Mon Jan 23, 2006 9:03 am

Thanx it works now.
i am new to this language so i axpect everything to be more complex :)

by trixmoto » Mon Jan 23, 2006 7:17 am

Is compares objects, you want to be comparing strings. Try this:

Code: Select all

'[CreateMainArtistName]
'FileName=CreateMainArtistName.vbs
'ProcName=CreateMainArtistName
'Order=1
'DisplayName=Create Main Artist
'Description=Copy AlbumArtistName or ArtistName to Main Artist
'Language=VBScript
'ScriptType=0

Sub CreateMainArtistName
  Dim list, itm, i
  Set list = SDB.CurrentSongList
  For i=0 To list.count-1
    Set itm = list.Item(i)
    If itm.Custom3 = "" Then
      If itm.AlbumArtistName = "" Then
        itm.Custom3 = itm.ArtistName
      else
        itm.Custom3 = itm.AlbumArtistName
    end if
  end if
  Next
  list.UpdateAll
End Sub

Custom field update script

by Paven » Mon Jan 23, 2006 7:13 am

Hello o hej
I have problem with assigning a value to my custom string.
basicly i got custom 3 as "Main Artist" i MM and would like i script that updates god "Album artist" or god "artist" on demand.
i sorting i use this field to sort artists to gether like John Lennon would have the beatles as Main artist.

thsi script supose to take album artist information or if not present artist information and stor it as "Main Artist" but i get an "Object Requierd" erro at line 15 colum 4

anyon with morexperiance that would help?

Code: Select all

'[CreateMainArtistName]
'FileName=CreateMainArtistName.vbs
'ProcName=CreateMainArtistName
'Order=1
'DisplayName=Create Main Artist
'Description=Copy AlbumArtistName or ArtistName to Main Artist
'Language=VBScript
'ScriptType=0

Sub CreateMainArtistName
  Dim list, itm, i
  Set list = SDB.CurrentSongList
  For i=0 To list.count-1
    Set itm = list.Item(i)
    If itm.Custom3 Is "" Then
      If itm.AlbumArtistName is "" Then
        itm.Custom3 = itm.ArtistName
      else
        itm.Custom3 = itm.AlbumArtistName
    end if
  end if
  Next
  list.UpdateAll
End Sub
ps i wish for an grouping function for artists in the futere.. making this scipt obsolete :)

Top