Auto Number Tracks

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

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

Topic review
   

Expand view Topic review: Auto Number Tracks

by kriscs1 » Sun Apr 01, 2007 9:12 am

Hi,
Well I don't care for album names so I've renamed all my albums to 'All' so that I can access them easier on my Zen (as before I could have had 5 different albums for 1 artist, all with just one song in). Because I've done this, I now need the songs to have track numbers so that they appear in alphabetical order.

by Bex » Sun Apr 01, 2007 9:05 am

Hi kriscs1,

I must ask why you want todo this?
Why don't you want to have correct numbering in your albums?

Re: Auto Number Tracks

by RedX » Sun Apr 01, 2007 8:42 am

kriscs1 wrote:Hi, I don't know anything about scripts really but I put this one together to automatically number tracks for each artists.
The problem is that when I select loads of tracks (well only about 100+ or so) the program seems to freeze up. Does anyone know why this is and how to stop it please? (and maybe a way to show it's current progress?)

Code: Select all

Sub AutoTrackNumber
  Dim list, itm, i, tmp
  Set list = SDB.CurrentSongList
  tmp = ""
  number = 0

For i=0 To list.count-1
    Set itm = list.Item(i)

    If itm.ArtistName = tmp Then
        number = number + 1
    Else
        number = 1
    End If
    tmp = itm.ArtistName
    itm.TrackOrder = number
    list.UpdateAll
Next

list.UpdateAll
End Sub
Thank you
(deleted code)

by kriscs1 » Sun Apr 01, 2007 8:40 am

Because the script I've made looks at the artist name for each song and when it comes across a new artist it starts numbering from 1 up to the total number of songs I have for that artist. The inbuilt script however simply numbers the songs from 1 up to the number of songs you have selected, ignoring the artist. My script therefore allows me to (or should allow me to) select my whole library and run the script in one go and not have to select the songs from each artist in turn which will take hours.

by RedX » Sun Apr 01, 2007 8:19 am

if you just watn to number tracks, why don't you use the biult in "auto increment track #" script under:
Tools->scripts->auto increment track #

just select the songs you want numbered in the correct order

Auto Number Tracks

by kriscs1 » Sun Apr 01, 2007 7:50 am

Hi, I don't know anything about scripts really but I put this one together to automatically number tracks for each artists.
The problem is that when I select loads of tracks (well only about 100+ or so) the program seems to freeze up. Does anyone know why this is and how to stop it please? (and maybe a way to show it's current progress?)

Code: Select all

Sub AutoTrackNumber
  Dim list, itm, i, tmp
  Set list = SDB.CurrentSongList
  tmp = ""
  number = 0

For i=0 To list.count-1
    Set itm = list.Item(i)

    If itm.ArtistName = tmp Then
        number = number + 1
    Else
        number = 1
    End If
    tmp = itm.ArtistName
    itm.TrackOrder = number
    list.UpdateAll
Next

list.UpdateAll
End Sub
Thank you

Top