Jump to content
Sign in to follow this  

Music Sorting Script!?!?

Recommended Posts



My music folders are kind of messed up with all musicfiles in diffrent folders and sevral dubble and triple copyes of the same file in diffrent folders....

So i wanted to make a script that could help me with this ..

i wanted the script to:

1. Let me select witch folder(s) i want the script to "Sort"

2. Let me chose where i want the music to be saved

3. When i click the "Start" button (or something like that) the sorting starts.

4. And gather all music and delete evry file that is dubble up (or more)

5. and make a new folder for each artist and name the folder the same name as the artist, and put evry musicfile from that artist in that folder..

Could someone help me to get started on this or does anyone know of a program that does just this..

Share this post

Link to post
Share on other sites

øhh.. your trying to explane to a noob here :)

Share this post

Link to post
Share on other sites


The following script will read the file properties of your music files ($Passed_File_Name is the full path of the music file):

; Object code modified from original by Simulcal & PsaltyDS

Func Read_Track_Info($sPassed_File_Name)

Local $aTrack_Info[4]
Local $sBit_Rate = "?"
Local $iError = 0

Local $iFilename_Start = StringInStr($sPassed_File_Name, "\", 0, -1)
Local $sDir_Name = StringLeft($sPassed_File_Name,$iFilename_Start)
Local $sFile_Name = StringMid ($sPassed_File_Name,$iFilename_Start + 1)
Local $sDOS_Dir = FileGetShortName($sDir_Name, 1)

Local $oShellApp = ObjCreate("shell.application")
If IsObj($oShellApp) Then
    Local $oDir = $oShellApp.NameSpace ($sDOS_Dir)
    If IsObj($oDir) Then
        Local $oFile = $oDir.Parsename ($sFile_Name)
        If IsObj($oFile) Then
            If @OSVersion = "WIN_VISTA" Then
                $aTrack_Info[3] = $oDir.GetDetailsOf ($oFile, 13); Artist
                $aTrack_Info[2] = $oDir.GetDetailsOf ($oFile, 14); Album
                $aTrack_Info[1] = $oDir.GetDetailsOf ($oFile, 21); Track
                $aTrack_Info[0] = $oDir.GetDetailsOf ($oFile, 26); Track number
                $sBit_Rate    = $oDir.GetDetailsOf ($oFile, 28); Bit Rate
            ElseIf @OSVersion = "WIN_XP" Then
                $aTrack_Info[3] = $oDir.GetDetailsOf ($oFile, 16); Artist
                $aTrack_Info[2] = $oDir.GetDetailsOf ($oFile, 17); Album
                $aTrack_Info[1] = $oDir.GetDetailsOf ($oFile, 10); Track
                $aTrack_Info[0] = $oDir.GetDetailsOf ($oFile, 19); Track number
                $sBit_Rate    = $oDir.GetDetailsOf ($oFile, 22); Bit Rate
                $iError = 4
            $iError = 3
        $iError = 2
    $iError = 1

If $iError > 0 Then
    Local $sMsg = "Could not read File Properties" & @CRLF & @CRLF & _
           $iError & @CRLF & @CRLF & $sPassed_File_Name
    MsgBox($MB_ICONEXCLAMATION, $MB_OK, "Error", $sMsg)


Now you have the details of each file - over to you to try and get the other parts working. We are here to help if you have problems - but we will not write the whole thing for you! :-)


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:


ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area


Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this