none
Dialogs.AskForFiles() RRS feed

  • Question

  • Hey! Could you help me?

    I use "Dialogs.AskForFiles". It gives me an array. And it looks like this:

    And I don't know hot to get only a name of the musical track. Any ideas?

    I have an idea:

    Check pair of symbols in every string. If the previous symbol is a lowercase and the next one is not and next symbols goes not like "aA" then cut a text after "a". Goint to try this right now but it would work in the case if a name of the song look like this: "asfsadgDSGAasGASaf.mp3". :) But I don't think that people name song like that.

    Friday, August 10, 2012 10:24 AM

Answers

  • How about this?     (Dialogs,  FilePlus are  dataextension's command)  

    path= Dialogs.AskForDirectory() '   your file path
    List=".mp4:.avi:.mov:.mp3"        '   extension  list ,  your choice
    a=FilePlus.GetAllFiles(path)         '   get  all file name (full path)

    For i=1 To Array.GetItemCount(a)
      ext=text.ConvertToLowerCase(FilePlus.GetFileExtension(a[i]))  '  get extension
      If text.IsSubText(List,ext) Then   '  if List contains ext (extension )
        NN=NN+1  
        musicList[NN]= FilePlus.GetFilename(a[i])+ext
        TextWindow.WriteLine( NN+" "+ musicList[NN])
      EndIf
    EndFor


    Friday, August 10, 2012 2:01 PM
    Answerer