title
Products            Buy            Support Forum            Professional            About            Codec Central
 
Page 1 of 2 12 LastLast
Results 1 to 15 of 29

Thread: Problem with .ReadIDTag

  1. #1

    Join Date
    Dec 2007
    Posts
    4

    Problem with .ReadIDTag

    I recently Downloaded (Few days ago) "dBpoweramp reference" for evaluation.

    I want to write some scripts to clean up the tags on parts of my mp3 collection.

    Every time I run the script below I get an error.
    C:\script\ListTags.vbs(11,2)
    Microsoft VBScript runtime error: Type mismatch: 'dMC.ReadIDTag'

    This refers to the call to:
    Call dMC.ReadIDTag(TheFile, i, Element, TheValue)
    Intellisense picks up the call and parameters correctly, it just wont execute.

    If I comment out the previous line: Call dMC.WriteIDTag(TheFile,"Comment", "Tested Again")
    this works fine and the tag is changed as expected.

    ' Test Script
    Set dMC = CreateObject("dMCScripting.Converter")
    Set WshShell = CreateObject("WScript.Shell")

    Dim Element, TheValue

    TheFile = "C:\Test.mp3"
    ' Read All IDTags
    For i = 0 To 10000
    ' Call dMC.WriteIDTag(TheFile,"Comment", "Tested Again")
    Call dMC.ReadIDTag(TheFile, i, Element, TheValue)
    If Element = "" Then Exit For
    Call WshShell.echo(Element,"=" , Value, 0)
    Next


    Any suggestions what is going wrong???

  2. #2
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    Perhaps?:

    Dim Element As String, TheValue As String

  3. #3

    Join Date
    Dec 2007
    Posts
    4

    Re: Problem with .ReadIDTag

    Ahh the wonders of Windows Scripting host...

    Every thing seems to be "Variant" :(

    so if I change the "DIM" statement to read:

    Dim Element as String
    Dim TheValue as String

    I get the error:

    C:\script\ListTags.vbs(5,13)
    Microsoft VBScript compilation error: Expected end of statement: Dim Element as String

    I did try
    Call dMC.ReadIDTag(TheFile, i, CStr(Element), CStr(TheValue))

    The did not throw any errors and executed, But also seems to pass the string by value, not reference, so I get empty strings back...

    B.T.W. This example came from the examples on your website. The rest of the script works fine, it's just this part.

    What I eventually want to do is read in all the tags. Put then in to a CSV file, edit them in Excel and write the sanitized tags back to the corresponding files.

  4. #4
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    Are you using Vista?

  5. #5

    Join Date
    Dec 2007
    Posts
    4

    Re: Problem with .ReadIDTag

    Windows XP SP2 - last (Windows) Updated about a week ago. Language English

  6. #6
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    I think you will have to use VB.NET to do this.

  7. #7

    Join Date
    Dec 2007
    Posts
    4

    Re: Problem with .ReadIDTag

    Oh Well.....

    I was just hoping for a quick solution.

    Now I have to write a VB application that will end up taking the next 2 to 3 months of my spare time.... :(

    It's not writing the code you understand, it's the endless tweaking and messing about with new features afterwards.

    Thanks for all your help, at least I won't waste any more time on a dead end scripted solution...

  8. #8
    dBpoweramp Enthusiast
    Join Date
    Feb 2008
    Posts
    59

    Re: Problem with .ReadIDTag

    Hi,

    I would like this to work using VBScript and failing a change to something like;

    Code:
    For i = 0 To 10000
    Tag = dMC.ReadIDTag("z:\abc.ape", i)
     If Tag = "" Then Exit For
     ...
    Next
    Where Tag would either be an key/value array or a string I can split on the first colon, or, alternatively;

    Remove the truncation of the lines when generating dMC.AudioProperties. This may be preferential as you wouldn't need to loop through (or read the file) an unknown number of times to get the tags.

    Daz

  9. #9
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    I will add to wish list to add to R13 (would be a while though, sorry).

  10. #10
    dBpoweramp Enthusiast
    Join Date
    Feb 2008
    Posts
    59

    Re: Problem with .ReadIDTag

    Hi,

    Thanks for the reply

    If there is to be one, would you consider simply fixing the truncation issue in an update to R12?

    Daz

  11. #11
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    Can you post an example of the truncation?

  12. #12
    dBpoweramp Enthusiast
    Join Date
    Feb 2008
    Posts
    59

    Re: Problem with .ReadIDTag

    Hi,

    Metaflac, etc. says;
    ACCURATERIPRESULT=AccurateRip: Accurate (confidence 5) [F7D9B17E]

    AudioProperties says;
    ACCURATERIPRESULT : AccurateRip: Accurat...idence 5) [F7D9B17E]

    Daz

  13. #13
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    Run dBpoweramp Configuration >> Music Converter >> Popup Info Tips >> Advanced and set Maximum Line Length to 10000

  14. #14
    dBpoweramp Enthusiast
    Join Date
    Feb 2008
    Posts
    59

    Re: Problem with .ReadIDTag

    Hi,

    Thanks again for the reply, but there is no difference. I assume the line length is for Editing purposes and the AudioProperties string is generated using the View code used for the limited width of the Explorer popup.

    Although it may be inappropriate to mention these here, if you have Unicode strings in the tags such as curly quotes, they are displayed properly, but on editing the string would seem to be interpreted as Windows-1251? and therefore contains illegible text.
    Also if you make a call to AudioProperties for a non-existent file there is output that includes the file type - should this not just generate an error or return nothing?

    Daz

  15. #15
    Administrator
    Join Date
    Apr 2002
    Posts
    43,852

    Re: Problem with .ReadIDTag

    It should have worked, if you are using Vista and the account is non-admin then the settings will not be saved in the right account (as it is elevated to admin), to fix set the account to admin.

Posting Permissions

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