iDate Added 1.5 - Updated 23/01/2008

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: iDate Added 1.5 - Updated 23/01/2008

Re: iDate Added 1.5 - Updated 23/01/2008

by Extrinsik » Sun Nov 26, 2017 10:37 am

Wow this worked perfectly. I got the error #5 like 226 column 10 and it was easily fixed by simply searching my computer for "iDateAdded" (using windows 10- was in C:\Users\[user]\AppData\Roaming\MediaMonkey\Scripts) opening the file with notepad, ctrl + f to find "Chr" and changing that value to "ChrW" as described earlier in the post.

I realize this is probably a bit redundant but I wanted to describe the solution in the absolute simplest and easiest to follow terms for the layman since I had not much else to add here.

Thank you so much to everyone involved here. I have been wanting to ditch iTunes for the longest time. Removing the headphone jack from the new iPhones was the final straw (especially since it is well known that older phone models start to seriously lose functionality once the newer models come out)

So stoked to finally be using a far more versatile functional and faster music library.

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Mon Jul 21, 2014 10:57 am

I think this must be caused by a change of MM behaviour as this used to work, but I've added it to my list to fix in the next version.

Re: iDate Added 1.5 - Updated 23/01/2008

by serendip1959 » Mon Jul 21, 2014 9:47 am

Having some further experience with the script I noticed that with the option for adding the track if not found, the date added in MM was not the one in the iTunes xml but the current date/time. I also noticed that running the script a second time caused the expected date added values to be written to the MM database. I think this may be due to when itm.UpdateDB is called MM creates a new record with the current date/time, overwriting the desired input value. Running the script a second time causes the record to be updated with the correct value. To avoid running the script a second time to get the correct date added values you can call itm.UpdateDB before the desired date added date is written and then call it again at the end to update the record with the correct date added.

This is only a issue if using the script to add tracks not in MM, not applicable when updating.

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Tue Jul 01, 2014 4:50 pm

Thanks again, I'll look at adding this into the next version. I'm glad you found the script useful.

Re: iDate Added 1.5 - Updated 23/01/2008

by serendip1959 » Tue Jul 01, 2014 3:49 am

Hi

I have adapted your script for personal use to take Itunes xml exported by another music player and sync the play data (date last played and play count) to Media Monkey. Checking through the skipped tracks in the log I found that the fixhex function was not always decoding the file path correctly, again causing a failed match. I am not sure if the problem was in the source rather than the script, but found that changing the fixhex function increased the match count significantly by returning special characters such as in "Live In Gdańsk" correctly for example. I found also that characters such as - or " in the path were also not decoded correctly (again maybe due to source rather than script). I was unable to solve this problem, but as it affected only around 12 tracks I simply edited the paths in the source program and Media Monkey, attaining complete matches.

This is a great script, solved a big syncing problem I had.

My alternative to the fixhex function was

Code: Select all

Function Decode(fixhex)
  Dim s1,s2,s3,d1,d2,b1,b2,b3
  Dim i : i = InStr(fixhex,"%")
  While (i > 0)
    s1 = Mid(fixhex,i+1,2)
    If IsHex(s1) Then
      d1 = HexToDec(s1)
      s1 = Left(fixhex,i-1)
      s2 = Mid(fixhex,i+4,2)
      If (Mid(fixhex,i+3,1) = "%") And (IsHex(s2)) Then
        d2 = HexToDec(s2)
        b1 = DecToBin(d1)
        b2 = DecToBin(d2)
        If (Left(b1,3) = "110") And (Left(b2,2) = "10") Then
          b3 = Mid(b1,4)&Mid(b2,3)
          s2 = Chrw(BinToDec(b3))
          s3 = Mid(fixhex,i+6)
        Else
          s2 = Chrw(d1)
          s3 = Mid(fixhex,i+3)
        End If
      Else
        s2 = Chr(d1)
        s3 = Mid(fixhex,i+3)
      End If
      fixhex = s1&s2&s3
    End If
    i = InStr(i+1,fixhex,"%")
  Wend
  Decode=Replace(fixhex,"'","'")
  
End Function

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Sun Jun 29, 2014 5:15 pm

Thanks for this, I'll look at adding this into the next version.

Re: iDate Added 1.5 - Updated 23/01/2008

by serendip1959 » Sun Jun 29, 2014 12:43 pm

Hi

The script breaks if any string data is on more than one line as it then assumes there are no more keys and execution does not reach the location data. This causes the sql songs query to be blank and no data to be returned causing the track to be not matched.

I added a regex test for intact string tags:

after Dim txt : Set txt = fso.OpenTextFile(xml,1,False) :

Code: Select all

  Dim objRE : Set objRE = New RegExp
  objre.Pattern="<string>([a-zA-Z\n\r\.\\0-99)\W])*<\/string>"
and after "Else" in Case 2 'reading track data :

Code: Select all

                If InStr(str,"<string>") > 0 And Not objRE.Test(str) Then 'string value that has breaks in it
    			Do Until objRE.Test(str)
    				str = str & txt.ReadLine 'add next line until string terminated correctly with closing tag
    			Loop
    		End if

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Mon May 19, 2014 6:44 pm

Have you modified the script at all? The line of code should be "itm.DateAdded = dad" but your error message reports it as "itm.Play Date UTC = dad".

Error #1025 VBScript Compilation Error

by BeShakey » Mon May 12, 2014 2:24 am

So if I'm going to switch to MediaMonkey I want to transfer all my last played dates from itunes. People report having done this by modifying the iDateAdded script. I had a go but got the following error:

Error #1025 - Microsoft VBScript compilation error
Expected end of statement
itm.Play Date UTC = dad

I don't have much of an idea what I'm doing so can someone suggest how to fix this?
thanks

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Sun Sep 29, 2013 4:23 pm

I suspect the XML file has drastically changed in the 5 years since this script was last updated, so this doesn't surprise me. The script is very out of date.

Re: iDate Added 1.5 - Updated 23/01/2008

by Tyko » Mon Sep 23, 2013 4:57 pm

I hate to bring up old issues but I have the most current script and it's having the problem where it processes a handful of tracks but doesn't find them.

Re: iDate Added 1.5 - Updated 23/01/2008

by trixmoto » Sun Sep 01, 2013 3:29 pm

The script is still called the same, but if it's been installed for the local user only, then it will now be in this location... %appdata%\MediaMonkey\Scripts\

iDateAdded error

by bdb484 » Tue Aug 27, 2013 12:27 am

I keep getting an error ("Invalid procedure call or argument: 'Chr'") after letting iDate run for quite some time.

I've already seen some discussion of the problem elsewhere in the forum (http://forum.mediamonkey.com/viewtopic. ... 30#p191984), but the suggested fix of editing C:\Program Files\MediaMonkey\Scripts\iDateAdded.vbs isn't doing me any good because I can't find that file anywhere on my computer.

Am I looking in the right place, or has the file been renamed or moved in the years since that thread?

Re: iDate Added 1.5 - Updated 23/01/2008

by lukesed » Fri Feb 08, 2013 4:42 am

I'm getting the error "Invalid procedure call or argument: 'Chr'" from line 226 of the script. This happens halfway through thousands of tracks.

Re: iDate Added 1.5 - Updated 23/01/2008

by pioniergeist » Thu Feb 23, 2012 10:52 am

Hi dear people,
Looking for a flexible portable audio library with a good search I came across MM, which is to replace my old FileMaker sound library.
Now I would like to import my data set (CD, title, description, comments) in MM, to the more than 7,000 Title (noise) does not need to tag again.
FileMaker offers me the opportunity to export my records as the following formats:

Rennie Tab text files (. Tab)
Comma Separated Text files (. Csv)
DBF files (. Dbf)
Serierbriefdateien (. Number)
HTMLTabeIIendateien (. Htm)
FiIeM aker Pro files (. Fp7)
Daeaen XML (XML)
Excel 95 2OO4 revision folders (. Xls)
Excel workbooks [. Xlsx)

What can I import into MM? Emergency on I-Tunes as a sort of import-export "Translator"?
I have already tried the program: "iDateAdded15.mmip" which XML files are imported, but it does not recognize title.
Basically I have a file with 4 columns (CD, title, description, comments) that I have to teach MM. Based on the title name of the MM can detect a match to the imported sound files.
I would really like to use MM. Do you have any tips?

Top