Search and Replace v1.21 [Script]

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

Search and Replace v1.21 [Script]

Postby DiddeLeeDoo » Mon Sep 11, 2006 6:13 am

This is a developing version of a simple 'Search and Replace' script.

Image

The script is case sensitive, so it can be used for Case changes.

The 'Remove '(Parentheses Text)' option take out the parentheses and their content.

The Search and Replace can be found in the Edit Menu after installation. ShortCut key is Ctrl+Shift+H.

It can be handy to use the Ctrl F command to find certain things you want modify before running the script.

Changelog:
1.00 - 1.10 : Added a whole lot of more fields
1.10 - 1.11 : Made an empty 'Search for' and none empty 'Replace with' act as a 'Set value if field is empty' function.
1.11 - 1:12 : Clean-up of code.
1.12 - 1.13 : Search to Clear correction.
1.13 - 1.14 : Menu item moved to the Edit menu, with Ctrl+Shift+H shortcut.
1.14 - 1.15 : Another clean-up, plus fix for non-skinned MediaMonkey
1.15 - 1.20 : Added ability to set values by using * in the Search field.
1.20 - 1.20b-e: Various fixes on a new model
1.20 - 1.21: Made it update only those songs who changed.

Please be aware that this script is 'work in progress' and is not fully tested. Use it to have a play with for now..

Code: Select all
Got time to test it today, and the script is not good at all, 'didn't fly' back to the work shop
Last edited by DiddeLeeDoo on Mon Mar 05, 2007 4:25 am, edited 30 times in total.
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby RandallSG » Mon Sep 11, 2006 8:52 am

I would love this script.

I would encourage you to consider adding both Album, Album Artist, and Genre in your next version. I end up changing items such as "R & B" to "R&B".

The ability to use masks would also be much appreciated. For example, I collect the Whitburn Billboard singles, and define album to include the Year, so the ability to insert something like "Whitburn Billboard Hot 100 - <Year>" would be very useful.

Also, while I have not yet tried the script, I hope that the script acts upon the current selection.

Thanks for the addition!
RandallSG
 
Posts: 35
Joined: Wed Jun 21, 2006 8:44 am

Postby MCSmarties » Mon Sep 11, 2006 9:06 am

What a great initiative, DiddeLeeDoo!

However, I would guess that by far the most useful fields for such a script are the "Comments" and "Lyrics" field.

Is there a way to call up this script WHILE editing these fields?
I am thinking of something like the search & replace function in notepad or MS word...

CTRL+R while editing one of these "long" fields brings up your script,
then you can replace characters or entire words.
Going even further, being able to use wildcards and special functions like in word would be useful.

Finally, the best would be a possibility to define macros!
ex: capitalize the first character of each line, replace ` by ', double lines by single lines...

Just a few ideas to (hopefully) arouse your curiosity!
MCSmarties
 
Posts: 248
Joined: Tue Dec 06, 2005 8:01 pm

Postby DiddeLeeDoo » Mon Sep 11, 2006 9:10 am

Glad you find it useful. I got tired of doing manual edit of some SongTitle values I wanted to change.

There's build in some Genre 'Magic' in MediaMonkey already.

Library > Genres
Then see all those
R & B
RB
R& B
R&B

genres there. What you do is to change the first one to R&B and you'll see, like magic that all the songs get changed and the R & B will join the R&B ones. It's quite fun to do when you get started.

Thank you for suggesting additions though, I'll look into it during the week...
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Mon Sep 11, 2006 9:14 am

@MCSmarties

Thank you for your feedback. All of those things you mention is possible, guess you'll see something like that too during the week.

Forgot about Lyrics, that's a good idea too. All those fields that's not that easy to do 'bulk' edit off..
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby Bex » Mon Sep 11, 2006 9:42 am

Hi, W. Kyle White wrote this script:
http://www.mediamonkey.com/forum/viewtopic.php?t=5160

Which has some smart functions:
- ReplaceStringInField
- ModifyField

But his script isn't the most beautiful one i've seen and it doesnt update the tags. But it's pretty smart and could perhaps add inspiration to this script.

/Bex
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!

All My Scripts
Bex
 
Posts: 6316
Joined: Fri May 21, 2004 5:44 am
Location: Sweden

Postby DiddeLeeDoo » Tue Sep 12, 2006 1:49 am

Moved the 1.1x code to the top...
Last edited by DiddeLeeDoo on Tue Sep 12, 2006 7:02 am, edited 1 time in total.
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Tue Sep 12, 2006 4:05 am

Thinking about it, I guess all those fields can be kept, but a preview of what's will be happening would make sense to ensure good results.....
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Tue Sep 12, 2006 11:36 am

Running a bit of testing when I get a moment. Updated to 1.13 at the moment.. Going through my collection and do various changes of this and that... See that more advanced functions could be handy, like expressions for example.
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby DiddeLeeDoo » Fri Sep 22, 2006 3:02 am

V1.20 - Added ability to set values by using * in the Search field
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby salamat » Wed Sep 27, 2006 8:15 am

This seems to be a great script DiddeLeeDoo, something I miss in MM...But where can I download it???????? Cannot see it anywhere here in this topic for download.....Or, do I overlooking something???

BTW, thank you so much for all the improvements you are doing for the use of MM....You are The Man!!!!!!
salamat
 
Posts: 23
Joined: Sun Aug 20, 2006 3:32 am
Location: Philippines

Postby DiddeLeeDoo » Wed Sep 27, 2006 8:28 am

I'm just bitten by the 'scripting bug' and it's fun to be able to 'think it - do it' :)

I took this script out due to I found it took far too much CPU power when doing thousands of files. Used it to do some thousand files here, and it brought my computer to it's knees.

Played around with it yesterday, and found a way to avoid the heavy CPU load, and will post an updated version here as soon as time allow.

Will also go trough possible fields and all that...

Have a bit much 'real work' to do these days, so updates to scripts here are not happening as fast as I would like.
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Postby salamat » Thu Sep 28, 2006 2:53 am

OK, I understand.........So I'll just wait patiently.....you just keep up your good work........when you have the time.....
salamat
 
Posts: 23
Joined: Sun Aug 20, 2006 3:32 am
Location: Philippines

Postby salamat » Thu Sep 28, 2006 3:10 am

BTW, it would be nice if it had the same function as in word for windows, this ? or * to replace any kind of letters with a space, e.g.; search for *_*, replace with
* *......., to fix all this annoing the_night_I_was_alone type of things......
salamat
 
Posts: 23
Joined: Sun Aug 20, 2006 3:32 am
Location: Philippines

Postby DiddeLeeDoo » Thu Sep 28, 2006 3:17 am

I agree with that, and that is something that can be done. I just dropped in that version in the 'works' at the moment, in the first post.

Haven't had much time to test it. The code have one of those functions at the moment.

If you use * in the Find what, you basically set values with the Replace with value.

Leave the Find what blank, and it will find fields that are blank, and set values for those only.

More stuff will be added too, and I hoping for some time next week do that, and also add an 'undo' function, so you can have a play without being too afraid of stuffing it up.
Image
DiddeLeeDoo
 
Posts: 1017
Joined: Wed Mar 01, 2006 1:09 am
Location: In a jungle down under

Next

Return to Need Help with Addons?

Who is online

Users browsing this forum: No registered users and 19 guests