Page 10 of 109
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Tue Oct 21, 2008 10:22 am
by SDJeff
Cool script!
For renaming files in general I use bulk rename utility
http://www.bulkrenameutility.co.uk/Main_Intro.php
I have a lot of photos that I have the need to add dates to the file name and other documents for work that would take hours to do one by one. I have used most of this script's reg exp presets in one way or another with BRU.
Since I've started using MM I just tag the MP3 an use auto-organize to rename the file.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Tue Nov 04, 2008 8:28 am
by Owyn
This has been my most frequently used script for the last while.
I have been busy adding sub-genre to Genre for my blues collection. Having the button pre-loaded with:
Find what: $
Into: Genre
RegExp: Checked
Makes it trivial to append a sub-genre to the current selection set.
Many thanks.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 19, 2008 1:44 am
by GuyScharf
How do I create a new preset?
When I start MM and open the RegExp dialog, the default preset is "0" and I can enter my new parameters there and save this as a new preset, which appears at the end of the list of presets.
So, that works for creating one new preset. How do I create a second new preset? I don't see how to create an "empty" preset that I can modify and save.
Thanks.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 19, 2008 2:39 am
by ZvezdanD
GuyScharf wrote:How do I create a new preset?
The Save button has three different functions, depending of applied modifications:
1. if you change only the Preset name of some existing preset - Save = Rename;
2. if you change some option of the existing preset, but not its name - Save = Update;
3. if you change some option of the existing preset AND its name as well - Save = Add new.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 4:50 am
by GuyScharf
I've been creating presets nicely but have now hit a snag.
I have a title of the form "yymmdd text" and I am trying to extract the "yymmdd" and put it in the date. My VBScript expression to do this is: mid(oSongData.Title,3,2) & "/" & mid(oSongData.Title,5,2) &"/20"&left(oSongData.Title,2) and the expression seems good, producing a result like "09/25/2008". However, when I run it, I get a VBScript runtime error "type mismatch" for "oSongData.year".
Do I need to do some kind of type conversion or is setting mm/dd in the date not supported? (I can set the date to 09/25/2008 by typing that value into the date field in MM.)
Thanks!
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 9:49 am
by ZvezdanD
GuyScharf wrote:or is setting mm/dd in the date not supported?
This is it. MM developers decided to introduce two new SongData properties with MM3, Month and Day, instead to extend existing property Year. I think they should have introduced YearString at least, as they did with TrackOrder and TrackOrderStr or DiscNumber and DiscNumberStr.
Maybe I would add some workaround for this in the next version of the script. In meantime, if you don't want to wait for it, you could modify the script by yourself adding the next lines to the SongDataDict collection on the begin of the script:
Code: Select all
If CurrentVersion() >= 300 Then
.Add "Month", "Month"
.Add "Day", "Day"
.Add "Original Month", "OriginalMonth"
.Add "Original Day", "OriginalDay"
End If
Also, you should add next lines to the isNumericDict collection:
Code: Select all
If CurrentVersion() >= 300 Then
.Add "Month", True
.Add "Day", True
.Add "Original Month", True
.Add "Original Day", True
End If
After that you could assign your dates with three presets, first you should assign a Year (i.e. Date), than a Month and in the end a Day. Not so practical, but it could do a work. Sorry for inconvenience.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 1:19 pm
by GuyScharf
Thank you. I updated regexp and the new Month and Day fields appear. But it does not appear to be working correctly.
I set the date to 2008 and that works fine.
I then set the month to 09 and the date becomes "9000" (as shown in MM display)
Similarly, when I set the day to 25, the date becomes "2500" (as shown by MM; it is "25" as shown by Windows Explorer)
Guy
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 1:50 pm
by ZvezdanD
I just tried and it works correctly. Could you send Find what and Replace with strings or even better the screenshots with your settings for each step?
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 2:04 pm
by ZvezdanD
By the way, I have slightly updated previous code because I wrote incorrectly Original Month and Original Day. It is not related to your attempt, but just in case if someone else is interested for this.
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Wed Nov 26, 2008 3:22 pm
by GuyScharf
It's certainly likely that I have done something wrong!
Whoops! Never mind! I found it; I wasn't putting the month and day into the correct field!
Thank you so much for the changes to RegExp. They will help me greatly.
Guy
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Sun Nov 30, 2008 12:12 pm
by justin_f
I'm trying to remove a specific string from a number of songs, and I don't know enough about Regular Expressions to figure it out, even after poking around a bit.
I download alot of songs from RCRDLBL.com, but the songs always have "Get free music at rcrdlbl.com" appended to the album title. What would I use to remove this without having to manually change each album?
Thanks in advance.
Justin
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Sun Nov 30, 2008 2:36 pm
by ZvezdanD
justin_f wrote:What would I use to remove this without having to manually change each album?
This could be very simple, you even don't need to use Regular expressions for that. Just type string which you want to remove into the
Find what field, choose Album from the
Into dropdown list and leave the
Replace with field blank. However, if you want to remove some string only from the end of some field, you could turn on the
Regular expression 1 and append "$" to the end of this string, e.g. " Get free music at rcrdlbl\.com$" (note the backslash in the front of the period in this case - this is because the perod has special meaning with regular expressions and the backslash is using to treat the next character as standard character).
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Tue Dec 02, 2008 1:33 pm
by justin_f
That was perfect. Did exactly what I needed. Thanks a ton.
Justin
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Fri Dec 05, 2008 4:21 pm
by FEB
I'd like to move all entries in the 'Publisher' section to 'Custom 2', so that I can sort by Publisher in the main pane. Can RegExp do this? If not, what can?
Thanks!
Re: RegExp Find & Replace 2.2.2 - with 50 presets [MM2+3]
Posted: Fri Dec 05, 2008 4:59 pm
by ZvezdanD
FEB wrote:I'd like to move all entries in the 'Publisher' section to 'Custom 2'
Just take a look at the "Copy the Date when the file is created to the Date added field" preset and choose wanted fields from
Into and
From dropdown lists. After copying, if you want to delete Publisher field, you could use the "Clear the Comment field" preset with changed field in the
Into dropdown list.