Jump to content

Song List


Recommended Posts

#include <file.au3>

; Shows the filenames of all files in the current directory

$search = FileFindFirstFile("*.mp3")

; Check if the search was successful

If $search = -1 Then

MsgBox(0, "Error", "No files/directories matched the search pattern")

Exit

EndIf

While 1

$file = FileFindNextFile($search)

If @error Then ExitLoop

_FileWriteLog(@ScriptDir & "\songlist.log",$file)

WEnd

; Close the search handle

FileClose($search)

This is the code I have so far. I just need to figure out how to search in all subdirectories as well. Any help again would be awesome.

Link to comment
Share on other sites

Do a search on the forum for "Recursive file search" and you should come up with some options.

Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.

Link to comment
Share on other sites

Forgive me, I am a little new and learning at a slow pace. Could someone possibly show me how I would incorporate that to just create a list of songs in all folders and subfolders. Thanks

#include <array.au3>

;Search for mp3 files recursively

$Array = RecursiveFileSearch(@DesktopDir & "\New Folder", "(?i)\.(mp3)", true)

_ArrayDisplay($Array)

Link to comment
Share on other sites

If you want the total number of songs, try this. It will append the count to the end of the file. (You can append the count to the top of the file too if you play around a bit. )

#include <File.au3>

RunWait(@ComSpec & " /c dir /s /b *.mp3 >> songlist.log","C:\",@SW_HIDE)
$File = FileOpen("C:\songlist.log",1)
FileWriteLine($File, "Total number of songs: " & _FileCountLines("C:\songlist.log"))
FileClose($File)
Link to comment
Share on other sites

Could Something like this be used to get a list of songs off of my server?? I want to make a flash player that uses URL's from my server but I have like 100+ songs and dont want to click on everyone and copy their names and then past into the players code. Can this be used on a server?

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...