Page 1 of 3

New mask functions

Posted: Sat Feb 23, 2008 5:45 pm
by jiri
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

Posted: Sat Feb 23, 2008 6:42 pm
by nohitter151
These should be very useful, I know some users have been asking for mask parameters like this. Can't wait to see them!

Posted: Sat Feb 23, 2008 7:35 pm
by Bex
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?

Posted: Sun Feb 24, 2008 4:27 am
by RedX
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?
This idea is really very good! I'd definitely love to see this in the next release!.

Have the new mask for the filenames been addad to the wiki?

Regards,
Red

Posted: Fri Feb 29, 2008 12:02 am
by dreifach
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>

Posted: Fri Feb 29, 2008 4:27 am
by jiri
<Type> tag for MP3, FLAC, etc.
Do you mean already existing <Extension>?
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.
I think that $Left(<Field>,n) should do what you want.
Include directory brackets in conditional statements
It doesn't work for you? Seems to work fine here.

Jiri

Posted: Fri Feb 29, 2008 4:39 am
by jiri
I realized that there's one more missing:

$Len(string) - returning the length of string, useful for $If() function.

Jiri

Posted: Fri Feb 29, 2008 3:15 pm
by Guest
OK Thanks! I did not know about these!

Is there any other mask reference for existing masks besides the help file? Those you just mentioned aren't in the help file under "Directory and Format Masks".

Posted: Fri Feb 29, 2008 3:26 pm
by Guest
It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.

Posted: Fri Feb 29, 2008 3:27 pm
by Teknojnky
Anonymous wrote:
It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.

did you try $\

?

Posted: Fri Feb 29, 2008 3:27 pm
by dreifach
Oops, sorry. That was me posting as "guest" above. I didn't realize I wasn't logged in.

Posted: Fri Feb 29, 2008 3:29 pm
by dreifach
Teknojnky wrote:
Anonymous wrote:
It doesn't work for you? Seems to work fine here.
No, this doesn't work. MM3 still parses the '\' weather they're in a 'if()' statement or not.

did you try $\

?
Duh. Ok, that works. Score me one point for the dumbass award. Thanks!

Posted: Sun Mar 02, 2008 8:21 pm
by MoDementia
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 :)

Posted: Sun Mar 02, 2008 9:20 pm
by MoDementia
Ah I know what I need now :)

<Folder:2,1>

So that it will only return 1 directory after skipping the first 2

D:\My Music\My Vinyl\AC-DC\'74 Jailbreak\

Returns 'My Vinyl'

Or

<Folder:1,2>

Returns 'My Music\My Vinyl"

Posted: Fri Mar 14, 2008 6:17 pm
by trixmoto
Presumably the $RemovePrefix and $MovePrefix use the "IgnoreTHEStrings" setting in the INI file? But do they also take into consideration the "IgnoreTHEs" setting?