Page 36 of 109
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Mon May 17, 2010 7:27 pm
by ZvezdanD
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).
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Tue May 18, 2010 8:34 am
by musthafa
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.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Tue May 18, 2010 9:26 am
by ZvezdanD
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.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Wed May 19, 2010 11:55 am
by Emrik
@ 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.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Wed May 19, 2010 1:51 pm
by ZvezdanD
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|.)*
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 2:40 am
by Emrik
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
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 2:57 am
by Emrik
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
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 9:00 am
by musthafa
Is there any feature to replace a particular word/string from all fields at a shot?
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 9:40 am
by ZvezdanD
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
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 9:52 am
by ZvezdanD
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)">"
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Thu May 20, 2010 9:55 am
by ZvezdanD
musthafa wrote:Is there any feature to replace a particular word/string from all fields at a shot?
Sorry, this is not possible.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Fri May 21, 2010 2:44 am
by Emrik
@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.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Fri May 21, 2010 4:29 am
by kiwichick
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.
Re: RegExp Find & Replace 4.0 w/ 194 presets (2010-04-14)[MM2+3]
Posted: Fri May 21, 2010 7:23 am
by ZvezdanD
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.
Re: RegExp Find & Replace 4.0 w/ 207 presets (2010-05-21)[MM2+3]
Posted: Fri May 21, 2010 10:41 pm
by kiwichick
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.