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

jpottsx1
Posts: 5
Joined: Tue Jan 05, 2010 10:20 am

Need Help with Auto Organize RegEx

Post by jpottsx1 »

I love the regex utility, but I'm not really a programmer type and I'm struggling to understand how to change the expression.

The script "Move files to <Genre>\<Artist>\<Album>\<Track#> - <Title>.ext" is a good starting point, but I have to organize my files a bit differently. I am forced to use two locations/drives, and my files then need to be sub-sorted by genre, then organized by Alphabet. For example I need to move files into this structure:

Example for mp3/acc/m4a = Z:\mp3\Alternative\A\Alabama 3\Exile On Coldharbour Lane\01 - Alabama 3 - Converted.mp3
OR
Example for flac = Y:\Flac\Alternative\C\Concrete Blonde\Bloodletting\01 - Concrete Blonde - Bloodletting (The Vampire Song).flac

The VBscript as it is presented within the utility;

Code: Select all

IIf(Len(oSongData.Genre) > 0 And Len(oSongData.ArtistName) > 0 And Len(oSongData.AlbumName) > 0 And Len(oSongData.TrackOrderStr) > 0 And Len(oSongData.Title) > 0, "$1\" & SDB.Tools.FileSystem.CorrectFilename(oSongData.Genre & "\" & oSongData.ArtistName & "\" & oSongData.AlbumName & "\" & Right("00" & oSongData.TrackOrderStr, 2) & " - " & oSongData.Title) & ".$4", oSongData.Path)
Does not seem to work. It inserts dashes "-" instead of backslashes "\" as expected. The actual output of the script is "Y:\Jazz-Coleman Hawkins-Coleman Hawkins! Roy Eldridge! Johnny Hodges! Alive! At the Village Gate-02 - Perdido.flac" I've read as much as I can digest and still cannot figure out why it does this.

Could someone point/help me in the right direction . . .

Thanks

Jeff
downundermike
Posts: 1
Joined: Sat Jan 03, 2009 1:50 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by downundermike »

Love this add on. Not good enough to figure out how to write code or manipulate the pre existing so any help would be appreciated.

I have taken one of the custom fields and renamed it featuring, so all additional artists on the track are listed in this field.

How do I then do a find and replace to move feat. from the end of song name, or artist name to Custom 1 " featuring "
FEB
Posts: 83
Joined: Sat Mar 01, 2008 6:57 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by FEB »

I have a request. Is it possible to populate one of the Custom fields with the AlbumID number?
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD »

FEB wrote:I have a request. Is it possible to populate one of the Custom fields with the AlbumID number?
Yes. You could use oSongData.Album.ID with the VBScript expression option.
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
FEB
Posts: 83
Joined: Sat Mar 01, 2008 6:57 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by FEB »

Fantastic! Thank you very much!
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

Just noticed some strange behaviour when i use RegExp with MM 4.1.0. 1640. ie RegExp is changinging thousands of files that have not been selected. This behaviour seems to have started happening in the last two releases of 4.1.0.
David
____________________________
Windows 10
MM 5 Beta
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD »

Davo wrote:Just noticed some strange behaviour when i use RegExp with MM 4.1.0. 1640. ie RegExp is changinging thousands of files that have not been selected. This behaviour seems to have started happening in the last two releases of 4.1.0.
Please, could you be more specific? Do you mean on changed tags in media files or what? How did you get changed files, i.e. did you use the RegExp Find and Replace dialog box or some specific preset from the Tag Manipulation Presets menu? Which panel of the program was active when that happened, the main tracklist or the Now Playing panel? Did you have at least one file selected in that panel before applying the preset? If you have used the RegExp F&R dialog box, did you have displayed "visible" or "selected" text at the bottom left corner of the dialog box next to the number of the current file?

Here is the excerpt from the first post of this thread:
"Maybe this is not obvious, so you should know that before you enter to the RegExp Find and Replace dialog box, you should first select tracks in the MM tracklist window for which you want to search or replace their data. If you don't select any track, this add-on will search/replace all tracks which are visible inside of the tracklist window. Please be very careful! If your tracklist has displayed all tracks from your database, after inappropriate usage of this add-on you could get undesired effect"

By the way, the next version of this add-on will not have such behavior with visible/selected tracks, precisely because of such situations like your, so if none track is selected then it will not apply the preset to all visible tracks.

However, if you have had at least one track selected when that happened then we have some another, more serious problem.
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
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

I only use the presets & always select the tracks i want to edit. I was in the Show Art with details panel.
The presets i used were "Remove specified number of words from beginning" Add specified string to beginning...."
The files were audio mp3 &flac. I was using the presets to edit the "title" tag.
From memory i think RegExp was changing the entire Collection rather than just the files i selected. I terminated RegExp when i realised what was happening.

Let me know if you need any other info & thanks for your quick response.
David
____________________________
Windows 10
MM 5 Beta
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

Image

After the editing problems in my original post I uninstalled RegExp then reinstalled but got the message above. I didn't update the presets & RegExp installed ok. Then I uninstalled & reinstalled again. This time i just got the usual " Do you want to install the 253 presets" message which i did.
Now everything works ok & i have'nt been able to replicate the problem. Maybe i screwed up the presets at some point although i have never deliberately modified any of them or created new ones.
David
____________________________
Windows 10
MM 5 Beta
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

Don't know what happened to the image. You can see it here: http://www.flickr.com/photos/29503587@N07/8917377297/
David
____________________________
Windows 10
MM 5 Beta
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD »

Davo wrote:After the editing problems in my original post I uninstalled RegExp then reinstalled but got the message above. I didn't update the presets & RegExp installed ok. Then I uninstalled & reinstalled again. This time i just got the usual " Do you want to install the 253 presets" message which i did.
Now everything works ok & i have'nt been able to replicate the problem. Maybe i screwed up the presets at some point although i have never deliberately modified any of them or created new ones.
That message is quite normal and could be seen during the re-installation of the add-on not only if you changed some predefined preset, but also if the new version of the add-on has some preset updated/improved. If you want to avoid such message you should choose removing of all add-on settings from the .ini file when uninstalling the add-on (which you, most probably, already did before the second attempt of the installation).

However, I don't think that updating the presets is a reason for not showing the mentioned problem again, and I suppose it is something else causing that. As I said, the only reason for such behavior that comes to my mind would be if you had none selected track in the active panel, i.e. the panel with the keyboard focus. Maybe you had the Now Playing panel active with all tracks from the library in it, but none selected? Please inform me if you could reproduce the problem again, so I could fix the bug.
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
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

OK - Spoke too soon. The problem re-occurred. Unfortunately it seems unpredictable. Occasionally even when a specific number of tracks are selected the RegExp dialogue shows that it ignores this & selects the entire Collection or Node.
Sorry I can't be more specific, at least i know now to keep an eye on the number of tracks showing in the RegExp preset dialogue
David
____________________________
Windows 10
MM 5 Beta
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

Here's another piece of the puzzle - It seems that when you "select" an entire album by left click in the album pane it highlights all the files but does not always "select" them. I noticed this when i was using the Case & Leading Zero addon. Because it asked me to select files even though i thought i had. This might explain why RegExp assumed i hadn't selected any files.
This seems more like a bug in MM than in RegExp
David
____________________________
Windows 10
MM 5 Beta
ZvezdanD
Posts: 3257
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by ZvezdanD »

Davo wrote:Here's another piece of the puzzle - It seems that when you "select" an entire album by left click in the album pane it highlights all the files but does not always "select" them. I noticed this when i was using the Case & Leading Zero addon. Because it asked me to select files even though i thought i had. This might explain why RegExp assumed i hadn't selected any files.
This seems more like a bug in MM than in RegExp
Well, yes, that would be some problem with the program itself, which I already reported to MM developers years ago. MediaMonkey has some really inconsistent way to select tracks after changing nodes in the Tree panel which you could see even with the built-in commands, not only with add-ons - just take a look at the enabled state of some built-in commands in the Tools or Edit menu, e.g. Convert Format, which should be disabled if none track is selected. I though that was changed with MM 4.0, but it seems that the same problem still exists.

By the way, if you click on some node in the Tree panel, then that panel takes the keyboard focus and becomes active. To be sure that you have some track selected, you should click on it in the main trackslist after selecting a node.

As you said, the only way to know how much tracks would be affected is to keep an eye on the number of tracks showing in the RegExp preset dialogue. Also, you should take a look at the status bar of the program which shows how much tracks are selected.
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
Davo
Posts: 431
Joined: Tue Nov 06, 2007 9:00 pm
Location: Australia

Re: RegExp Find & Replace 4.3 w/ 253 presets (2011-07-06) [M

Post by Davo »

Thanks ZvezdanD for your assistance & also for the work you have done on RegExp Find & Replace especially the presets which makes the editing capability available to a wider non expert audience.
Regards
David
____________________________
Windows 10
MM 5 Beta
Post Reply