I need to write a function to trim all but the last four digits from the date (%YEAR% i think) of a bunch of MP3s. Currently most of them have "January 1, 2000" formatting and i would like to have everything other than the year removed.
I hope my question made sense and thank you for any help!
This worked, but I'm wondering if there is some redundancy in how I used this function.
When I create an action type of "Format Value" I am prompted to choose a field, (in this case YEAR), and I'm wondering if this makes part of "$right(%year%,4)" redundant and if this could cause any problems. I will be saving this function to use whenever I convert from my FLAC collection to MP3.
It is not redundant, because you can write the content of $right(%year%,4) - the 4 numbers 2000 in your example - in every tag you want. Not only into the choosen YEAR tag, but also into every other tag.
If you choose YEAR in this case, you overwrite the current content "January 1, 2000" with "2000".
If you would choose another tag like COMMENT as Field:
you would copy the part "2000" from YEAR and write it into COMMENT.
The YEAR tag would be left unchanged, the current content of COMMENT would be replaced.
I guess this really depends on what your end requirement is. If you don't want to keep the month and date (I don't think too many players will respond to "January") then discarding this info when replacing the lengthy %year% tag value with the newly updated 4 digits isn't redundant. However if you feel that you may need to keep that original data intact for some future purpose, you may want to at least copy that info to a custom tag field for now. Then you can update the actual %year% tag and still have both. The amount of data consumed for this is really insignificant compared to the music anyhow.
My confusion was me not realizing how the format string actually worked, the "year" being used to call from a field while writing to a field was handled separately. It all makes sense now and from here I think I can probably cobble together my own arguments once I find a list of fields and functions. Thank you again!