title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Results 1 to 8 of 8

Thread: Converting a whole folder or multiple files

  1. #1
    Unregistered

    Question Converting a whole folder or multiple files

    Would like to automate nightly process of converting multiple files (~1000 per day).

    Using scripting means have to use addfromfile and list each individual file in script.

    File Selector is nice tool to convert entire folder structure, but can it be called from script or command line?

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    39,956
    >Using scripting means have to use addfromfile and list each individual file in script.

    Your script could be smart and do a search for files and addfromfile on found file, convert...and so on.

  3. #3
    Unregistered
    Would like the script to be smart. However I am not, and do not know how to perform such functionality beyond the help info for scripting.

    Is this an easy task?

    Thanks

  4. #4
    Administrator
    Join Date
    Apr 2002
    Posts
    39,956
    If you knew programming in visual basic, there are functions to call that can search for files and you can pass them (don't ask me though, I last touched VB 7 years ago).

  5. #5
    Unregistered

    Smile

    Just a quick note to let you know....

    Had a VB guru look at. Wrote a few lines and now converting folders automated by Task Scheduler every night.

    Thanks.

  6. #6
    Unregistered
    is it to late to share? I would like to do the same thing maybe even post the VB script and ow to use it?

  7. #7
    Unregistered
    Will put a post together in the next couple of days with the script.

  8. #8
    Unregistered
    call waveconvert("mycnv")

    Sub WaveConvert(directory)

    ' ================================================== ================================
    'These next few lines are directly from dbconverter script

    ' Create dMC Object
    Set dMC = CreateObject("dMCScripting.Converter")

    ' Set My options (Volume norm off, ID Tag Preservation On, No delete Source files)
    dMC.VolumeNormalize = False
    dMC.PreserveTags = True
    dMC.DeleteSourceFiles = True

    dMC.ConvertToFolder = False ' Puts converted file into same folder
    ' ================================================== ================================

    ' Because we put each days recordings into a folder based on the Month, then a sub-folder based on the date, need to create the folder names into variables for path.
    ' There are many ways of doing this. I did it this way.

    myDay = Day(Now)
    myMonth = Month(Now)
    myMonthName = MonthName(Month(Now))
    myYear = Year(now)

    myYear = right(myYear,2)

    if mymonth < 10 then mymonth = "0" & mymonth
    if myday < 10 then myday = "0" & myday

    myFolder = mymonth & "-" & myDay & "-" & myYear


    Dim fso, fldr, fls, fl, fldrPath, fPath, fExt, i
    i=0
    fldrPath = "d:\" & myMonthName & "\" & myFolder & "\"
    fExt = ".WAV" 'MUST BE CAPS
    Set fso = CreateObject("Scripting.FileSystemObject")
    Set fldr = fso.GetFolder(fldrPath)
    Set fls = fldr.Files

    For Each fl In fls
    ' check for file type
    If UCase(Right(fl.Name, 4)) = fExt Then
    ' build full path of file
    fPath = fldrPath + fl.Name

    ' ================================================== ================================
    ' Add My Files to Convert
    Call dMC.AddFromFile(fPath)
    ' ================================================== ================================


    End If
    i = i + 1
    Next

    Call dMC.GoConversion("Wave", True, True, True, False)

    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •