RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [MM2+]

Download and get help for different MediaMonkey for Windows 4 Addons.

Moderators: Peke, Gurus

Muther
Posts: 27
Joined: Thu Jun 05, 2008 3:47 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by Muther »

Vista UAC, user account with limited access, anti-virus or some HIPS? Do you get same error every time when you restart MM program?
XP SP3 Full admin access No new anti virus or protection (I don't get this error with any other script install or even v2.1.2 of this script) and no I don't get the error on start up and everything seems fine now.

As a matter of fact I just re-installed the script as a test, I got no error at all, so it must have been a conflict with the old script or some random error with my setup. after I uninstalled the old script I had no problem at all. I would say unless you get someone else with the same problem this is just an anomaly and can be forgotten. :)

Thanks for your help and patients.
Okram

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by Okram »

Hi Zvezdan!

this is a great work. I use it to assign average bitrate to my folders. Excellent!

I only have one suggestion: on folders it doesn't actually replace them but it creates new folders. It would be useful if, when renaming, it would also delete emptied (old) folders at the same time.

Also It would be great if it would be possible to save own presets under a new name.

Cheers!
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

Okram wrote:I only have one suggestion: on folders it doesn't actually replace them but it creates new folders. It would be useful if, when renaming, it would also delete emptied (old) folders at the same time.
Sorry, but this is not its purpose. All it should do is to replace content of the Path field, remaining job is internal to MediaMonkey itself. So, I think you should report this to the Bug or Wishlist forum of MM.
Also It would be great if it would be possible to save own presets under a new name.
I don't know what is happening, this is a second report about such thing. I need to repeat - it works fine on my computer. In the fact, all predefined presets I created using the Save button of this script.

Just to make thing clearer - if you choose some existing preset and change only its name, after a click on the Save you will get renamed existing preset, not the new preset. This is done like this because I didn't wanted to put one more button for the Rename option into already crowded dialog. If you want to save the new preset starting from some existing preset you need to change at least one option in the dialog box, for example you could enter different Description.

To resume:
1. if you change only the Preset name of some existing preset - Save = Rename;
2. If you change some options of the existing preset, but not its name - Save = Update;
3. if you change some options of the existing preset and its name as well - Save = Add new.
Actually, I already implemented the option for the Save button to change its caption depending of the mentioned mode, but dropped that idea and choose the single name for this button. Maybe I need to add this information about its behavior to the first post of this thread into the Usage section.

Please let me know if you still have a problem with this.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
Okram

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by Okram »

Thanks, still I wish this would work similar to Auto Organize files where there is an option to delete emptied folders.It is inconvenient to manually delete all old folders.

About saving new preset, you are right, it works ok like you described. I guess it was just not obvious to me...
barkoz
Posts: 121
Joined: Fri May 02, 2008 5:58 pm
Location: Sydney, Australia

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by barkoz »

ZvezdanD, I love your script this is very useful and was wondering if it would be possible to rename lyrics so the first letter of all words in the lyrics are Uppercase and the rest Lowercase. If it is would you be so kind as to show me the settings I would need to use as it's a little bit over my head at the moment.
Thanks mate
:D :D :D :D
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

barkoz wrote:if it would be possible to rename lyrics so the first letter of all words in the lyrics are Uppercase and the rest Lowercase
Did you tried the preset "Capitalize the Title" with selected Lyrics item in the "Into" dropdown list? After choosing this item you could change a name of the preset, e.g. "Capitalize the Lyrics", and click on the Save button to store it as a new preset.
barkoz
Posts: 121
Joined: Fri May 02, 2008 5:58 pm
Location: Sydney, Australia

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by barkoz »

How easy was that! Sorry for being such a dummy, I will spend more of my time experimenting in future instead of wasting yours.
Thank mate, much appreciated I knew this was good but i'm just now getting an idea of how good.
:D :D :D :D :D
barkoz
Posts: 121
Joined: Fri May 02, 2008 5:58 pm
Location: Sydney, Australia

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by barkoz »

Well I managed to work out how to replace those funny characters ie ´, ` that cause the next letter to be capitalised but is it possible to do them all with one preset. At the moment I have three separate presets to do three different accents changing them to ' and then capitalise the field and avoiding the (Ain´T). Is it possible to add all three accents that I have come across to the one preset, changing them all to '. This would save me running three presets before I can capitalise the field. :D :D
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

barkoz wrote:Is it possible to add all three accents that I have come across to the one preset, changing them all to '.
Yes, it is possible, but I think you typed only two characters, not three (third is a comma, right?). Here are settings:
Find what:

Code: Select all

[´`]
Regular expression 1: checked
Replace with:

Code: Select all

'
Regular expression 2 and VBScript expression: unchecked

You should put your third character inside of squared brackets in the Find what field. But you could even modify the Capitalize the Lyrics preset, so you don't need to do any previous step before it:
Find what:

Code: Select all

([\w\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF])([\w'´`\xDF-\xF6\xF8-\xFF\u0100-\u024F\u0400-\u04FF]*)
Note two added characters after ([\w'.
barkoz
Posts: 121
Joined: Fri May 02, 2008 5:58 pm
Location: Sydney, Australia

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by barkoz »

Thank's mate works well it did confuse me a bit at first because your second solution didn't change the characters from ´`’‘ to ' it just avoided the letter following being capped. But that is ok, i'm not that pedantic, I just didn't like the odd caps and this works like a charm, I've also learned a little bit more about what can be done with this. With nearly 110,000 tracks to get uniform I can see me giving this little baby a floggin'. Doesn't seem to be a lot it can't do. :D :D :D I'm grinnin'
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by nynaevelan »

Hi:

Can someone (ZvevDanD) help me create a preset similar to the Capitalize the Title preset except I want it to be in script case. Can someone help me??

BTW, it's been throwing up some error when I select alot of files but I am not sure how many but it happened with a minimum of 6200 tracks selected. I was trying to have it select the files which needed replacements. It's not a major problem but thought you should know. Here's a sample, it's too big for me to get to the bottom.

Image

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

nynaevelan wrote:a preset similar to the Capitalize the Title preset except I want it to be in script case.
Could you tell me what is a "script case"?
nynaevelan wrote:it's been throwing up some error when I select alot of files but I am not sure how many but it happened with a minimum of 6200 tracks selected. I was trying to have it select the files which needed replacements. It's not a major problem but thought you should know.
Yes, I'd like to know for any errors if you find them. There is a problem with mentioned error and its screenshot because the error message is too long and could not fit on the screen, so I cannot see a full SQL query. I suppose that it is too long for the SQLite engine because you selected so many tracks, but this is very unlikely considering that SQLite supports queries of 1 million characters. Anyway, I could only suggest two solutions in such case:
1. try to use fewer selected tracks, or
2. instead of selecting tracks which needed replacements you could try to remove tracks which don't needed replacements (option Keep to replace).
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by nynaevelan »

ZvezdanD wrote: Could you tell me what is a "script case"?
Sentence case ie. from This Is The Way It Is to This is the way I want it
ZvezdanD wrote: Yes, I'd like to know for any errors if you find them. There is a problem with mentioned error and its screenshot because the error message is too long and could not fit on the screen, so I cannot see a full SQL query. I suppose that it is too long for the SQLite engine because you selected so many tracks, but this is very unlikely considering that SQLite supports queries of 1 million characters. Anyway, I could only suggest two solutions in such case:
1. try to use fewer selected tracks, or
This is the workaround I have been using. Also, no idea how to test this in SQLite or Bex's SQL Viewer.
ZvezdanD wrote:2. instead of selecting tracks which needed replacements you could try to remove tracks which don't needed replacements (option Keep to replace).
I have no idea how to do this, I don't see a "keep to replace" option.

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by ZvezdanD »

nynaevelan wrote:Sentence case ie. from This Is The Way It Is to This is the way I want it
You could try the preset "Uppercase the first letter of sentence or each folder/filename of the Path" with selected Title in the Into dropdown list. However, with this preset all words would be converted to the lowercase except the first one of the sentence - so it would be in lowercase also English "I", personal names... If you want I could modify the preset to convert "I" into uppercase, but personal names is somewhat more difficult because it needs a list of all possible names, something like the preset "Capitalize the Title with exceptions".
nynaevelan wrote:no idea how to test this in SQLite or Bex's SQL Viewer.
If you want to help me to resolve this bug, you could modify the script in the Notepad. You should insert next lines:

Code: Select all

    Dim oFile
    Set oFile = SDB.Tools.FileSystem.CreateTextFile("c:\temp\RegExpMsg.txt", True)
    oFile.Write sTmp
    oFile.Close
to the line 1265, i.e. between:

Code: Select all

                 End If
and:

Code: Select all

                If CurrentVersion() < 300 Then
If you want I could send you already modified version of the script. After implementing the option "Select to replace" you would find the file RegExpMsg.txt in the c:\temp\ folder which you should send me. It would not contain full SQL query, but only the WHERE part. So, you could test this file by yourself with SQLite or SQL Viewer if you add

Code: Select all

SELECT * FROM Songs WHERE 
on the begin.
nynaevelan wrote:I have no idea how to do this, I don't see a "keep to replace" option.
By default the first button next to the left of the Close button represents an option "Keep matched". If you click on the small button next to the right of it which contain the down arrow you would get a dropdown list with several options: Keep matched, Keep unmatched, Keep to replace, Select matched, Select unmatched and Select to replace.
Magic Nodes 4.3.3 / 5.2 RegExp Find & Replace 4.4.9 / 5.2  Invert Selection/Select None 1.5.1  Export/Create Playlists for Child Nodes 4.1.1 / 5.4.1  Expand Child Nodes/Expand All 1.1.2  Event Logger 2.7  Filtered Statistics Report 1.6  Track Redirection & Synchronization 3.4.2  Restore/Synchronize Database 3.1.8 / 4.0.1  Find Currently Playing Track 1.3.2  Queue List 1.2.1  Add to Library on Play 1.0.1  Tree Report for Child Nodes 1.1.1  Update Location of Files in Database 1.4.5 / 2.3  Inherit Child Playlists 1.0.3  Add Currently Playing/Selected Track(s) to Playlist 1.2
nynaevelan
Posts: 5559
Joined: Wed Feb 07, 2007 11:07 pm
Location: New Jersey, USA
Contact:

Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]

Post by nynaevelan »

Where should I send the file?

EDIT: The Keep to Replace works without the error or the limitation in files selected. What is the difference between Keep to Replace an Select to Replace?

Nyn
3.2x - Win7 Ultimate (Zen Touch 2 16 GB/Zen 8GB)
Link to Favorite Scripts/Skins

Join Dropbox, the online site to share your files
Post Reply