Andromo - Start Making Apps - Free Signup

Announcement

Collapse

New Forum Software

If you're here, you've found the new home for our forums. There will be some bugs to iron out, so thanks for your patience...
See more
See less

Example : Populate a tree from MP3's in a Folder and Output to textfile for playlist

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Example : Populate a tree from MP3's in a Folder and Output to textfile for playlist

    This is an example of how to populate mp3's to a tree object from a folder and output each file to a textfile for later use. [maybe a playlist]

    This is a modified version of TristanD's example which is located here

    On Global Functions:
    Code:
    function GetFolderContentsFromDialog()
       folderbrowse = Dialog.FolderBrowse("Please select a folder:", _SourceDrive);
       if (folderbrowse ~= "CANCEL") then
         MP3 = File.Find(folderbrowse, "*.mp3", true, false, ShowSearchProgress, nil);
      	 if MP3 then
      	     for index, path in MP3 do
      	       MP3path = path
      	       TextFile.WriteFromString("AutoPlay\\Docs\\playlists\\default.txt", MP3path.."\r\n", true);
      	     end
      	     for i,v in MP3 do
      	        tbSplit = String.SplitPath(v);
      		    name = tbSplit.Filename
      			  tblNodeData = {};
      			  tblNodeData.Text = name;
      			  tblNodeData.Data = v;
      		    Tree.InsertNode("Tree1", "3", tblNodeData);
      	     end
      	  end
       end
    end
    Button On Click Event:
    Code:
    GetFolderContentsFromDialog()

  • #2
    :yes nice work, but whats the code for:

    the root of autoplay audio and if youre running more albums and expand the tree, select youre track and audio load?

    my scripting still noobie:o

    Comment


    • #3
      Nice

      Thank you TimeSurfer!! Nice work. :yes

      Joe

      Comment

      Working...
      X