New mask functions
Moderator: Gurus
New mask functions
Sometimes there are needs for more complex masks by our users and so I added a couple of new mask functions. They will be available in the next release, let me know whether this is enough or whether you have some other useful ideas:
- $RemovePrefix(string) - Removes starting 'The', i.e. 'The Beatles' -> 'Beatles'
- $MovePrefix(string) - Moves starting 'The' to the end of string, i.e. 'The Beatles' -> 'Beatles, The'
- $Group(string,integer) - Groups the first letter of the first parameter to groups of letters given by the second (optional) paremeter. Works just like <Artist@1>.
- $Replace(string,what,by) - Replaces all occurences of 'what' by 'by' in 'string'.
- $If(<Year><1990,...) - $If() function now accepts also <,<=,>,>= and <> operators. E.g. $If(<Year><1990,80's,$If(<Year><2000,90's,2000's)) returns 80's for year 1984.
- $Assign(variable,value) and $Use(variable) - Variables that can be used several times in mask, e.g. '$Assign(V,A)$Use(V)$Use(V)' produces string 'AA'.
- $First(string,count,start from) - There was added parameter 'start from' (optional), which specifies to skip a number of items in multi-value string. E.g. $First(a;b;c,1,1) returns 'b'.
Jiri
- $RemovePrefix(string) - Removes starting 'The', i.e. 'The Beatles' -> 'Beatles'
- $MovePrefix(string) - Moves starting 'The' to the end of string, i.e. 'The Beatles' -> 'Beatles, The'
- $Group(string,integer) - Groups the first letter of the first parameter to groups of letters given by the second (optional) paremeter. Works just like <Artist@1>.
- $Replace(string,what,by) - Replaces all occurences of 'what' by 'by' in 'string'.
- $If(<Year><1990,...) - $If() function now accepts also <,<=,>,>= and <> operators. E.g. $If(<Year><1990,80's,$If(<Year><2000,90's,2000's)) returns 80's for year 1984.
- $Assign(variable,value) and $Use(variable) - Variables that can be used several times in mask, e.g. '$Assign(V,A)$Use(V)$Use(V)' produces string 'AA'.
- $First(string,count,start from) - There was added parameter 'start from' (optional), which specifies to skip a number of items in multi-value string. E.g. $First(a;b;c,1,1) returns 'b'.
Jiri
-
- Posts: 23640
- Joined: Wed Aug 09, 2006 10:20 am
- Location: NJ, USA
- Contact:
These should be very useful, I know some users have been asking for mask parameters like this. Can't wait to see them!
MediaMonkey user since 2006
Need help? Got a suggestion? Can't find something?
Please no PMs in reply to a post. Just reply in the thread.
Need help? Got a suggestion? Can't find something?
Please no PMs in reply to a post. Just reply in the thread.
Great enhancement!
One thing I miss sometimes in Auto-Tag from Filename is to be able to assign a "value" to more than one field.
e.g.
Path: C:\Music\Abba\1 - Waterloo.mp3
Mask: <Artist,Composer,Lyricist>\<Track#>-<Title>
Would tag Artist, Composer and Lyricist with Abba
Perhaps also some functions for fixing various FirstName LastName scenarios?
One thing I miss sometimes in Auto-Tag from Filename is to be able to assign a "value" to more than one field.
e.g.
Path: C:\Music\Abba\1 - Waterloo.mp3
Mask: <Artist,Composer,Lyricist>\<Track#>-<Title>
Would tag Artist, Composer and Lyricist with Abba
Perhaps also some functions for fixing various FirstName LastName scenarios?
Advanced Duplicate Find & Fix Find More From Same - Custom Search. | Transfer PlayStat & Copy-Paste Tags/AlbumArt between any tracks.
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
Tagging Inconsistencies Do you think you have your tags in order? Think again...
Play History & Stats Node Like having your Last-FM account stored locally, but more advanced.
Case & Leading Zero Fixer Works on filenames too!
All My Scripts
This idea is really very good! I'd definitely love to see this in the next release!.Bex wrote:Great enhancement!
One thing I miss sometimes in Auto-Tag from Filename is to be able to assign a "value" to more than one field.
e.g.
Path: C:\Music\Abba\1 - Waterloo.mp3
Mask: <Artist,Composer,Lyricist>\<Track#>-<Title>
Would tag Artist, Composer and Lyricist with Abba
Perhaps also some functions for fixing various FirstName LastName scenarios?
Have the new mask for the filenames been addad to the wiki?
Regards,
Red
Here's a few off the top of my head:
<Type> tag for MP3, FLAC, etc.
Something similar to <'Field':n>, but truncate to n and don't pad with spaces if <n -- I would like this so filenames don't get too long, so I can truncate artist names to like 10 characters, but not have artists with names less than 10 chars expanded.
Include directory brackets in conditional statements. Like:
$If(<Album Artist>="Various",<Album:1>\<Album> - <Year>,<Album Artist:1>\<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>
Instead of:
$If(<Album Artist>="Various",<Album:1>,<Album Artist:1>)\$If(<Album Artist>="Various",<Album> - <Year>,<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>
<Type> tag for MP3, FLAC, etc.
Something similar to <'Field':n>, but truncate to n and don't pad with spaces if <n -- I would like this so filenames don't get too long, so I can truncate artist names to like 10 characters, but not have artists with names less than 10 chars expanded.
Include directory brackets in conditional statements. Like:
$If(<Album Artist>="Various",<Album:1>\<Album> - <Year>,<Album Artist:1>\<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>
Instead of:
$If(<Album Artist>="Various",<Album:1>,<Album Artist:1>)\$If(<Album Artist>="Various",<Album> - <Year>,<Album Artist> - <Year> - <Album>)<Disc#>-<Track#> - <Artist> - <Title>
Do you mean already existing <Extension>?<Type> tag for MP3, FLAC, etc.
I think that $Left(<Field>,n) should do what you want.Something similar to <'Field':n>, but truncate to n and don't pad with spaces if <n -- I would like this so filenames don't get too long, so I can truncate artist names to like 10 characters, but not have artists with names less than 10 chars expanded.
It doesn't work for you? Seems to work fine here.Include directory brackets in conditional statements
Jiri
Anonymous wrote:No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.It doesn't work for you? Seems to work fine here.
did you try $\
?
New script:
Last.FM Node Now with DJ Mode!
Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page


Last.fm + MediaMonkey = Scrobbler DJ!
Tag with MusicBrainz ~ Get Album Art!
Tweak the Monkey! ~ My Scripts Page

-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Trying to nest a $Replace inside an $If statement cant get it to work
D:\My Music\My Vinyl\AC-DC\'74 Jailbreak\'74 Jailbreak_01_Jailbreak.wma
D:\My Music\
$If($Replace(<Folder>,My Vinyl,)<><Folder>,My Vinyl,Unknown Source)
\<Album Artist>\<Album>\<Album>_<Track#:2>_<Title>
EDIT: Bah going by the date these arent in 1140 yet I'm guessing
Hence they probably wont work 
D:\My Music\My Vinyl\AC-DC\'74 Jailbreak\'74 Jailbreak_01_Jailbreak.wma
D:\My Music\
$If($Replace(<Folder>,My Vinyl,)<><Folder>,My Vinyl,Unknown Source)
\<Album Artist>\<Album>\<Album>_<Track#:2>_<Title>
EDIT: Bah going by the date these arent in 1140 yet I'm guessing


Last edited by MoDementia on Sun Mar 02, 2008 11:19 pm, edited 2 times in total.
-
- Posts: 1321
- Joined: Thu Jun 15, 2006 3:26 pm
- Location: Geelong, Victoria, Australia
Presumably the $RemovePrefix and $MovePrefix use the "IgnoreTHEStrings" setting in the INI file? But do they also take into consideration the "IgnoreTHEs" setting?
Download my scripts at my own MediaMonkey fansite.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.
All the code for my website and scripts is safely backed up immediately and for free using Dropbox.