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

Download and get help for different MediaMonkey Addons.

Moderators: Peke, Gurus

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Mon May 17, 2010 7:27 pm

Emrik wrote:I want to add the name of the playlist in the comment field

My intention was to use Preset 135 : Add "(Live)" to the end of Title and modify it so that Live=playlist name (I will type the playlist name each time myself) & field = Comment.
I am not sure, but I think that it would be better if use Bex's Playlist in Main Window add-on for this. If you decide to stay with RegExp, you could use the mentioned preset as you described, but with it you need to enter playlists names manually. However, here are settings for presets which will assign playlists names automatically:
Preset: Assign names of contained playlists to <Into Field>...
Find what: ^.*
Into: Comment
Regular expression 1: checked
Replace with:

Code: Select all

SQLQuery("SELECT group_concat(PlaylistName, '<String Caption="Separator" Value="; ">') FROM PlaylistSongs INNER JOIN Playlists ON PlaylistSongs.IDPlaylist = Playlists.IDPlaylist WHERE PlaylistSongs.IDSong = " & oSongData.ID & " GROUP BY IDSong")
VBScript expression: checked

After adding this preset, you could start it using Edit / Assign names of contained playlists to <Into Field>... This dialog is much simpler then the RegExp Find and Replace dialog box and allows you to choose just destination field and separator between playlists names. You understand that each track could be contained in several playlists, right?
Emrik wrote:i will also use the grouping field to put the MM ratings as grouping field also exist in Itunes Mac so i could then convert grouping field in Itunes Ratings.
I am not sure that you could use simple copy method, because rating values are different. Ratings in MM are from 0 to 100, and I think that iTunes has ratings between 0 and 10. So, you need to use Replace with: Round(oSongData.Rating / 10). If you want to copy rating only for rated tracks, you could use something like: IIf(oSongData.Rating = -1, "$&", Round(oSongData.Rating / 10)) (instead of $& you could enter value which iTunes use for undefined rating).
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

musthafa
Posts: 2
Joined: Tue May 18, 2010 8:24 am

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by musthafa » Tue May 18, 2010 8:34 am

Hi,
I'm getting 404 error while trying to download the plugin from : http://solair.eunet.rs/~zvezdand/RegExp ... 4.0.2.mmip .
Please help me out with a mirror link.

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Tue May 18, 2010 9:26 am

musthafa wrote:I'm getting 404 error while trying to download the plugin
Sorry, I uploaded .html file, but I forgot to upload .mmip file. Interesting that nobody reported broken link for a whole week : :-? There is a new release: v4.0.2 - 2010-05-10
* Fixed: <Number> tag with MinValue and MaxValue arguments.
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Emrik
Posts: 157
Joined: Sat Feb 03, 2007 6:26 pm
Location: Paris

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by Emrik » Wed May 19, 2010 11:55 am

@ ZvezdanD

thanks a lot for your advice, i've tried it but apparently there is a mistake in the "Assign names of contained playlists to <Into Field>...", i have the red message "Expression error!" is there a issue with the mistake with the script ?

i had a look to the script "playlist in main window" but it is not exactly what i'm looking for but RegExp Find & Replace will perfectly do the job.Thanks anyway for the info because i was not aware of its existence.

regarding ratings, i will actually recreate the ratings on Itunes Mac via doing an auto playlist on "grouping field" = "5stars" (i have already put this info on MM via gathering all the ***** and putting "5stars" in their grouping field). then on Itunes Mac i will select all the mp3 in this playlist and massively rate them 5 stars in Itunes. The grouping field will thus serve me only as a "exchange" field to do the correspondance...

Anyway thanks again for your support.
Paris, France.
Mediamonkey 3, HP Vista & MacBook Pro.
Mixvibes 7 producer, Trackor Pro, Allen & Heath Xone 4D.

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Wed May 19, 2010 1:51 pm

Emrik wrote:i've tried it but apparently there is a mistake in the "Assign names of contained playlists to <Into Field>...", i have the red message "Expression error!" is there a issue with the mistake with the script ?
Eh, I always forget that Comment field could contain several lines of text. I suppose that you got that message only with tracks that already contain multi-line comment. If this is a case, you should write Find what string as ^(?:\n|.)*
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Emrik
Posts: 157
Joined: Sat Feb 03, 2007 6:26 pm
Location: Paris

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by Emrik » Thu May 20, 2010 2:40 am

it works well but it erases my former comments, however I would like to keep them and add and the end of the already existing comments the playlists info ?

And if i may add some complexity i would also like to avoid to double tag by mistake a mp3 file i.e. do you think it is possible to make a check before tagging that the playlist info is not already in the comment field. if it is already in it then the script does not double the playlist name or only the playlist name that is not already written in the comment (for mp3 that are in several tags)

Anyway thanks again this is already very good.

all the best
Paris, France.
Mediamonkey 3, HP Vista & MacBook Pro.
Mixvibes 7 producer, Trackor Pro, Allen & Heath Xone 4D.

Emrik
Posts: 157
Joined: Sat Feb 03, 2007 6:26 pm
Location: Paris

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by Emrik » Thu May 20, 2010 2:57 am

another quick question with the script "Preset 135 : Add "(Live)" to the end of Title" modified to put the name of the playlist (manually) at the end of the comment field

- it doesn't add anything when the comment field is empty, it works like a charm when the comment field contains something and it adds perfectly the typed playlist name at the end.

Do you have any suggestion to correct that ?

thanks again
Paris, France.
Mediamonkey 3, HP Vista & MacBook Pro.
Mixvibes 7 producer, Trackor Pro, Allen & Heath Xone 4D.

musthafa
Posts: 2
Joined: Tue May 18, 2010 8:24 am

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by musthafa » Thu May 20, 2010 9:00 am

Is there any feature to replace a particular word/string from all fields at a shot?

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Thu May 20, 2010 9:40 am

Emrik wrote:it works well but it erases my former comments, however I would like to keep them and add and the end of the already existing comments the playlists info ?
Replace with:

Code: Select all

"$&" & IIf(Len("$&") > 0 And Len(SetVar(0, SQLQuery("SELECT group_concat(PlaylistName, '<String Caption="Separator" Value="; ">') FROM PlaylistSongs INNER JOIN Playlists ON PlaylistSongs.IDPlaylist = Playlists.IDPlaylist WHERE PlaylistSongs.IDSong = " & oSongData.ID & " GROUP BY IDSong"))) > 0, vbCrLf, "") & IIf(Len(GetVar(0)) > 0, "Playlist(s): " & GetVar(0), "")
Emrik wrote:i would also like to avoid to double tag by mistake a mp3 file i.e. do you think it is possible to make a check before tagging that the playlist info is not already in the comment field.
Sorry, but this is not so simple and this is a reason why I suggested Bex's add-on since it automatically updates custom field when some track is added or removed from some playlist. If you still want to use Comment field, I could only suggest to first remove all existing playlists information from Comment field and then apply mentioned preset. Here are settings for preset which removes only playlists information, but leave all previous content of Comment field:
Find what: \s*Playlist(s): .+$
Regular expression 1: checked
Replace with: empty
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Thu May 20, 2010 9:52 am

Emrik wrote:with the script "Preset 135 : Add "(Live)" to the end of Title" modified to put the name of the playlist (manually) at the end of the comment field

- it doesn't add anything when the comment field is empty, it works like a charm when the comment field contains something and it adds perfectly the typed playlist name at the end.
Well, this is already mentioned in Description of that preset (only if the Title is not empty). If you want to assign specified string to some field, even if that field is empty then you should write Find what: $ and Replace with: IIf(Len("$_") > 0, " ", "") & "<String Caption="String to append" Value="(Live)">"
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Thu May 20, 2010 9:55 am

musthafa wrote:Is there any feature to replace a particular word/string from all fields at a shot?
Sorry, this is not possible.
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

Emrik
Posts: 157
Joined: Sat Feb 03, 2007 6:26 pm
Location: Paris

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by Emrik » Fri May 21, 2010 2:44 am

@ZvezdanD thanks a lot for all your precious help, i'm now ready to move to Itunes Mac waiting for MM to launch its Mac Version.

Take care.
Paris, France.
Mediamonkey 3, HP Vista & MacBook Pro.
Mixvibes 7 producer, Trackor Pro, Allen & Heath Xone 4D.

kiwichick
Posts: 320
Joined: Tue Jul 21, 2009 6:35 am

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by kiwichick » Fri May 21, 2010 4:29 am

Hi there, I've just installed this and it's awesome!!! I have come across a little problem though - not sure if it's this addon, another addon or something to do with MM. I don't like the toolbar buttons being as big as they are so I'm trying to change the size via the "Trim toolbar button's caption" option but when I change the max size from 15 to 10 I get this error:

Error #424 - Microsoft VBScript runtime error
Object required" 'SDB.Objects(...)'
FIle: "C:\Program FIles\MediaMOnkey\Scripts\Auto\RegExpReplace.vbs", Line: 1278, Column: 28

Then after I click OK I get this error:

Error happened during script execution:
Object required" 'SDB.Objects(...)'

After this I have one toolbar button that has changed size but the rest are still the same. When I restart MM they have all gone back to the original size 15. Any help is appreciated.

ZvezdanD
Posts: 3097
Joined: Thu Jun 08, 2006 7:40 pm

Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]

Post by ZvezdanD » Fri May 21, 2010 7:23 am

kiwichick wrote:I don't like the toolbar buttons being as big as they are
If you select some Icon in RegExp dialog, they would be even smaller.
kiwichick wrote:I'm trying to change the size via the "Trim toolbar button's caption" option but when I change the max size from 15 to 10 I get this error:
Thanks for the report. There is a new release: v4.0.3 - 2010-05-21
* Added: 13 new presets;
* Fixed: error when "Trim toolbar button's caption" value is changed.
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.2  Add Currently Playing/Selected Track(s) to Playlist 1.1.2

kiwichick
Posts: 320
Joined: Tue Jul 21, 2009 6:35 am

Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]

Post by kiwichick » Fri May 21, 2010 10:41 pm

Hi ZvezdanD, Yes I figured out the icon thing after posting - looks nicer too. Glad to know there actually is an issue though. Thanks very much for the response.

Post Reply