Hi MediaMonkeys!
Since some people asked for it I played a bit around and created a script which imports the date of creation of a file and writes it into DateAdded. It's very simple but it only imports the date when it's older than DateAdded.
Just select the files you want to change, open the script over Tools/Scripts/DateCreated2DateAdded.
By the way: I recommend to do a backup of your library first because there's no way to undo the change of DateAdded. Just to be on the safe side.
' MEDIAMONKEY SCRIPT: DateCreated2DateAdded
' Author: Big_Berny supported by RedX
' Version: 1.21
' Date: 17/04/2008
'
' This script reads the creation date of a file and writes it into the DateAdded-field.
'
' Install:
' - Save this script as plain text file named DateCreatedOrLastModified2DateAdded.vbs to the MediaMonkey /Scripts-folder.
' - Add the following lines to Scripts.ini:
'
' [DateCreated2DateAdded]
' FileName=DateCreatedOrLastModified2DateAdded.vbs
' ProcName=TheDate2DateAdded("DateCreated")
' Order=7
' DisplayName=DateCreated2DateAdded
' Description=Imports the file's Created-date and stores it in DateAdded
' Language=VBScript
' ScriptType=0
' [LastModified2DateAdded]
' FileName=DateCreatedOrLastModified2DateAdded.vbs
' ProcName=TheDate2DateAdded("DateLastModified")
' Order=7
' DisplayName=LastModified2DateAdded
' Description=Imports the file's LastModified-date and stores it in DateAdded
' Language=VBScript
' ScriptType=0
'************************************************************************************
Sub TheDate2DateAdded(TheDate)
Dim SongList : Set SongList = SDB.CurrentSongList
Dim FSO : Set FSO = CreateObject("Scripting.FileSystemObject")
Dim File, Song, SongDate, i
If SongList.Count = 0 Then
SDB.MessageBox "No songs selected!", mtError, Array(mbOK)
Exit Sub
End If
Dim ProgressBar : Set ProgressBar = SDB.Progress
ProgressBar.Text = "Importing..."
ProgressBar.MaxValue = SongList.Count
For i = 0 To SongList.Count - 1
If ProgressBar.terminate Then
Exit Sub
End If
ProgressBar.Value = i + 1
Set Song = SongList.Item(i)
Set File = FSO.GetFile(Song.Path)
execute("SongDate = File."&TheDate)
If DateValue(Song.DateAdded) > DateValue(SongDate) Then
Song.DateAdded = SongDate
Song.UpdateDB
Song.WriteTags
End If
Next
End Sub
Last edited by Big_Berny on Wed Apr 16, 2008 6:39 pm, edited 6 times in total.
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Just see it as a little 'Thank you' for testing AutoRateAccurate!
Big_Berny
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
The code with the bar looks a bit to big and complicated. Could be done a lot easier. But as long as it works...
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
Big thanks for this script (and also for Accurate)!
Unfortunately I've let MM autosort my files and also moved them to another drive, so the file date is set to march 2008.
Is there any possibility to recover the original date from the files? I think that Windows or MM created new files while sorting them, but perhaps someone knows something?
Hmmm dont know if the orginal date is still in tact if you move it to other drive tho. This script worked like a charm for me tho and still many thanks m8 you made my day well week even!
@treponem: Yes, sometimes this happens but I don't know when exactly. Unfortunately the original date can't be restored. BUT you could look in the file preferences in windows if the 'Changed'-date is older than the 'Created'-date. If yes we could import that value.
I also have files which 'were created' on 14.4.2007 and changed on 4.3.2005 which isn't really logic...
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design
@Big_Berny: Nope, the 'changed-date' is older than the created one, but also set to March 08, too.
There would be no trouble for me if I had switched to MM earlier, I thought I was happy with Winamp for too long. Thanks again for your help, this script could have improve Autorate for me, it's my own fault not to have looked for a Winamp-alternative earlier than Jan '07.
Hi, I'm just looking for a script to change 'Original Date' to be the same as 'Date' on selected tracks. I thought I could alter this script to do what I want but I don't know enough about scripting to do it. Could someone show me what to change to make it do what I want?
Queseuq wrote:Hi, I'm just looking for a script to change 'Original Date' to be the same as 'Date' on selected tracks. I thought I could alter this script to do what I want but I don't know enough about scripting to do it. Could someone show me what to change to make it do what I want?
Ok, here is a new version 1.2 of the script. Now you can import DateCreated and DateLastModified. I also integrated RedX' progressbar into my code which is simpler.
The files and the scripts.ini-entries are different from older versions. So please remove the older version and its ini-entries first.
Big_Berny
@Red: Could you please remove your code? So that the users really get the new code.
Last edited by Big_Berny on Wed Apr 16, 2008 6:37 pm, edited 1 time in total.
Scripts in use: Genre Finder / Last.fm DJ / Magic Nodes / AutoRateAccurate / Last.FM Node
Skins in use: ZuneSkin SP / Eclipse SP AutoRateAccurate 3.0.0 (New) - Rates all your songs in less than 5 seconds!
About me: icoaching - internet | marketing | design