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

Thread: automation whith vbs

  1. #1

    Join Date
    May 2006
    Posts
    4

    Unhappy automation whith vbs [RESOLVED]

    I would like to convert all the files contained in a repertory towards another repertory with a file vbs.
    I manage to convert one; but how I can say select all the files of the repertory with "dMC.AddFromFile" ?
    Last edited by 13841384; 05-15-2006 at 09:22 AM.

  2. #2
    dBpoweramp Guru LtData's Avatar
    Join Date
    May 2004
    Location
    USA
    Posts
    8,288

    Re: automation whith vbs

    Moved to the Developer section of the forum.
    Also, see here: http://www.dbpoweramp.com/developer-scripting-dmc.htm

  3. #3
    QueMaster donny's Avatar
    Join Date
    Oct 2002
    Location
    Europe - Serbia - Novi Sad
    Posts
    761

    Re: automation whith vbs

    why don't you just iterate trhu the list and convert one by one? with a for command or something like that... (i'm not really a vb man but it should be easy to do..)

  4. #4

    Join Date
    May 2006
    Posts
    4

    Re: automation whith vbs

    Quote Originally Posted by donny
    why don't you just iterate trhu the list and convert one by one? with a for command or something like that... (i'm not really a vb man but it should be easy to do..)
    By what I want to convert a series of file wav into mp3, and that the name and the number of file vary.
    With the fact, which I want is:
    I have a repertory or are copied files wav automaticly, and I would like, automaticly convert these files towards another repertory.
    The file vbs that I have fact can convert a precise file towards this repertory; the problem, I do not manage to make this file vbs so that it select all the files of the repertory, and then which convert them towards a repertory.
    Like dMC can manually convert many files selected, I wondered how to do it make automaticly.
    Here current file VBS:
    Code:
    ' Create dMC Object
    Set dMC = CreateObject("dMCScripting.Converter")
    
    ' Set My options (Volume norm on, ID Tag Preservation On, No delete Source files)
    dMC.VolumeNormalize = True
    dMC.PreserveTags = True
    dMC.DeleteSourceFiles = False
    
    ' Set Output Folder (to D:\CONVERTED)
    dMC.ConvertToFolder = True
    dMC.ToFolder = "D:\CONVERTED"
    
    ' Add My Files to Convert
    Call dMC.AddFromFile("D:\TOCONVERT\test.wav")
    
    ' Convert To Wave (No option page, Want Overwrite page, Want finished, Want Errors)
    Call dMC.GoConversion("Mp3 (Blade)", True, True, True, False)
    How to modify the line:
    Code:
    Call dMC.AddFromFile("D:\TOCONVERT\test.wav")
    So that the vbs takes all the files of the repertory ?

    Thank for a answer !

  5. #5
    dBpoweramp Enthusiast Deano's Avatar
    Join Date
    Jan 2006
    Posts
    130

    Re: automation whith vbs

    Do some research into Microsoft's built-in file scripting object. You can call it via:

    Code:
    Set fSO = CreateObject("Scripting.FileSystemObject")
    You should be able to use this to open folders and iterate through its entire contents, then you should be able to dynamically insert the filename into the correct place in your script.

    Take a look here

  6. #6

    Join Date
    May 2006
    Posts
    4

    Re: automation whith vbs

    Quote Originally Posted by Deano
    Do some research into Microsoft's built-in file scripting object. You can call it via:

    Code:
    Set fSO = CreateObject("Scripting.FileSystemObject")
    You should be able to use this to open folders and iterate through its entire contents, then you should be able to dynamically insert the filename into the correct place in your script.

    Take a look here
    Thanks for answer, it's good for select, but Call dMC.AddFromToFiles(VAR) or
    Call dMC.AddFromFile(VAR) don't convert the list ! A idea ?

  7. #7

    Join Date
    May 2006
    Posts
    4

    Talking Re: automation whith vbs

    I have the solution !

    Code:
    ' Create dMC Object
    Set dMC = CreateObject("dMCScripting.Converter")
    
    ' Set My options (Volume norm on, ID Tag Preservation On, No delete Source files)
    dMC.VolumeNormalize = True
    dMC.PreserveTags = True
    dMC.DeleteSourceFiles = False
    
    ' Set Output Folder (to D:\AUDIOTEMP\CONVERTED )
    dMC.ConvertToFolder = True
    dMC.ToFolder = "D:\AUDIOTEMP\CONVERTED"
    
    Dim fso, f, f1, fc, s
       Set fso = CreateObject("Scripting.FileSystemObject")
       Set f = fso.GetFolder("D:\AUDIOTEMP")
       Set fc = f.Files
       For Each f1 in fc
       s = "D:\AUDIOTEMP\" & f1.name 
       MsgBox ("s is: " & s)
       Call dMC.AddFromFile(s)
    ' Add My Files to Convert
    'Call dMC.AddFromFile(s)
    
    ' Convert To Wave (No option page, Want Overwrite page, Want finished, Want Errors)
    Call dMC.GoConversion("Mp3 (Blade)", True, True, True, False)
    
    Next
    Thank all :smile2:

  8. #8
    QueMaster donny's Avatar
    Join Date
    Oct 2002
    Location
    Europe - Serbia - Novi Sad
    Posts
    761

    Re: automation whith vbs

    nice...

    it's always good to have pieces of code for examples around the forum :D

Posting Permissions

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