PDA

View Full Version : Converting a whole folder or multiple files



Unregistered
08-05-2003, 04:41 PM
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?

Spoon
08-06-2003, 05:57 PM
>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.

Unregistered
08-07-2003, 10:41 AM
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

Spoon
08-07-2003, 05:23 PM
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).

Unregistered
08-18-2003, 04:38 PM
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.

Unregistered
08-20-2003, 10:13 PM
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?

Unregistered
08-26-2003, 08:19 PM
Will put a post together in the next couple of days with the script.

Unregistered
08-29-2003, 03:33 PM
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