Script for several field modifications

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: Script for several field modifications

Re: Script for several field modifications

by Jentse » Sat Oct 25, 2008 10:58 am

Hey guys,
This script sounds like the thing I just need!
I want to avoid superlong lists of artists and albums in my Zune, when putting all my compilation (single, downloaded tracks mostly) traks on it.
You know, all those artists and albums with just 1 song in it.... I hate that!
I think this script might do the trick, when I can: 1. put <ARTIST> together with the title like <ARTIST>.<TITLE>, 2. name all artist fields 'Various' to avoid those long lists in the Zune, and name all Album fields with <GENRE>.

But, I'm a noob with those scripting codes etc.
Could someone please explain how I can start to use the script, or hand me a .exe file of it?

Thanks a lot, from a Dutch Zune and MM enthusiast! :D
greetz, Jentse

Re: Script for several field modifications

by sommo » Sat Jun 28, 2008 12:32 pm

I would just like to say a thank you W. Kyle White, for this addon!
This is one of the reasons why I use MediaMonkey!
It is really helpful and I do use it :)
Keep up the good work & Happy coding!

by Bex » Mon May 12, 2008 4:51 pm

Thanks! :D

You should have posted in the right thread though.. :wink:

Case & Leading Zero Fixer 1.4.2

by rithym » Mon May 12, 2008 4:47 pm

AwEsOmE sCrIpT!!

works like a charm right click menu and status bar are a nice touch especially with 60k tracks... all checked and edited in under 20 mins. :D

nice work a superb enhancement to MM3

by Bex » Mon May 12, 2008 6:06 am

case script

by rithym » Mon May 12, 2008 4:04 am

a total noob question can someone advise if it is possible to customise the case script to implement change on one field at a time for example just the track Title field without changing anything else TIA

by sommo » Tue Apr 15, 2008 10:48 am

It works with MM3! :)
Great if it could be turned into a installer file :P

by NLS » Wed Mar 12, 2008 12:04 pm

so does this script work?

should we try to use it?

Umm...

by thefaceman » Wed Jul 04, 2007 7:23 pm

OK. Someone recommended this script but I could not tell what it was suppose to do.

I only want to change one word at time in one field.

Example. Let me replace "dont" with don't" in the title field.

-thanks
-thefaceman

-ps- It sounds like this script might do what I want but I am afraid that the script will do MORE than I want.

by Rojer » Sun Jun 10, 2007 5:59 am

Thanks Steegy,

Unfortunately, I do not own msoffice, so that I cannot run this simple search and replace. I usually edit the database in Open Office 2.2 'sbase', which is enough for simple operations, like changing the media serial number.

I was not able to find a convenient way to replace a text string in a field, either by query or sql.

What i need is to run a simple UPDATE with string replace arguments:

Code: Select all

UPDATE Songs SET SongPath = REPLACE(SongPath,'\:\\', '\:\\Music\\MediaMonkey\\Mp3\'s\\')
This would replace the root (D:\) With a deeper path (f:\Data\Music\MediaMonkey\Mp3's)

Unfortunately, it appears that the Sql support in Open Office Base is limited to SELECT queries, plus a few others that do not appear to be documented in any easily available place. The UPDATE function, or at least the REPLACE" is definitely not there.

It still bugs me that I should buy a multi$ bloatware just to perform a nasty text search and replace in a locked document. This is definitely the bigger bummer about Media Monkey : wonder how Microsoft managed to fool talented programmers into this net.

Still, I find it odd for MM to actually alter the file system after running the script... Anyway, this script seems to allow great things and i am sure I will make some profit of it.

by Steegy » Sun Jun 10, 2007 5:29 am

The only way to change the paths without letting MM move the tracks is (I think) by changing the path directly in the database (manually with MSAccess or with a script using SQL query).
When you do this through MediaMonkey (manually with MediaMonkey or with a script using MediaMonkey's functions), it'll move the files on the FS too.

So, maybe a simple "find & replace" within MSAccess is the simplest (not even the need for a script).

by Rojer » Sun Jun 10, 2007 4:04 am

I am trying to use this script to change the path for the whole library. The idea is simple : run the script to change path in db and then just move the files in explorer.

I believe this would be better than either:
  • Auto organize function : I have more than one organization patterns and I am not willing to mess with them
    Find moved tracks : this works only partially (16.000 files found over 41.000.
The reason I want to do this is that the mp3 dedicated drive is full and I have installed a raid (1000 GB). Thing is I don't want the new drive to be dedicated to mp3's anymore : way too big and performing for this. Hence I need the files to be stored in a mp3 subfolder instead of the root.

So as for now, the files are still stored in root.

I installed the script and added a line in FieldDict:

Code: Select all

.Add "<PATH>", "Path" 
Then I just replace :\ with :\Mp3's\

This seems to work except MM will actually move the files ! This triggers dialog boxes about attached files, which is impossible. Plus, if I don't mind messing with the mdb file, I am not comfortable with letting the script actually handle such large amounts of data without any safety net.

Well actually, I have cloned the drive before running the script, but I believe most people can't.

Would it be possible to make the script change the field without actually reflecting the changes in the filesystem ? In case of mistake, a mere database restoration would fix the whole thing, which is better than restoring the actual data.

Last point is that moving the mp3 folders in Windows Explorer takes about 1 second, while MM while actually rename the files and check for attached files, which takes forever.

Fixed bug in RemoveCategoryFromCustom1

by jd776 » Tue Jun 05, 2007 12:24 am

Firstly, I would like to send out big thanks to W. Kyle White and the other posters for making these scripts available.

I found a problem with the RemoveCategoryFromCustom1 sub and I am posting the fix.

The problem: When you add three categories, then remove the second category the comma between the first category and the third category disappears, thereby fusing the first and third categories together.

I replaced

Code: Select all

s = s & "itm.Custom1 = Replace(itm.Custom1, '', ''&Category&'','', ''''):"

Code: Select all

  s = s & "itm.Custom1 = Replace(itm.Custom1, '', ''&Category&'', '', '', ''):"
And now it works! :)


Here is the Sub with the change included:

Code: Select all

Sub RemoveCategoryFromCustom1 
  ' Define variables 
  Dim category, s 

  category = Trim(SkinnedInputBox("Enter the Category to remove", "Remove Category", "Blah"&Chr(34))) 
    if (category = "") then 
      Exit Sub 
    End If 
    

  s =     "If(itm.Custom1 = Category) Then:" 
  s = s & "  itm.Custom1 = '''':" 
  s = s & "  itm.UpdateDB:" 
  s = s & "End If:" 
  s = s & "itm.Custom1 = Replace(itm.Custom1, '', ''&Category&'', '', '', ''):"
  s = s & "itm.Custom1 = Replace(itm.Custom1, Category&'', '', ''''):" 
  s = s & "itm.Custom1 = Replace(itm.Custom1, '', ''&Category, ''''):" 
   s = s & "itm.UpdateDB:" 
  s = Replace(s, "''", Chr(34)) 
  kwExecuteStatement Replace(s, "Category", kwToString(Category)) 
End Sub 

by trixmoto » Tue Apr 17, 2007 4:52 am

I've just fixed the code becuase there was a double quote missing. Thanks for pointing it out Bex. :)

You RULE, Steegy, you RULE!

by TequilaM » Tue Oct 31, 2006 9:41 pm

You just made my Halloween night. Thanks!!!

Top