title
Products            Buy            Support Forum            Professional            About            Codec Central
 

automation whith vbs

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

    • May 2006
    • 4

    automation whith vbs

    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; May 15, 2006, 02:22 PM.
  • LtData
    dBpoweramp Guru

    • May 2004
    • 8288

    #2
    Re: automation whith vbs

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

    Comment

    • donny
      dBpoweramp Guru

      • Oct 2002
      • 761

      #3
      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..)

      Comment

      • 13841384

        • May 2006
        • 4

        #4
        Re: automation whith vbs

        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 !

        Comment

        • Deano
          dBpoweramp Enthusiast

          • Jan 2006
          • 130

          #5
          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

          Comment

          • 13841384

            • May 2006
            • 4

            #6
            Re: automation whith vbs

            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 ?

            Comment

            • 13841384

              • May 2006
              • 4

              #7
              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:

              Comment

              • donny
                dBpoweramp Guru

                • Oct 2002
                • 761

                #8
                Re: automation whith vbs

                nice...

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

                Comment

                Working...

                ]]>