Fill media type based on file type

I'm looking to create an action that will look at the file type (mp3, m4a, etc.) then assign a MEDIATYPE and/or ITUNESMEDIATYPE. For example...

  1. MP4 will get it's MEDIATYPE/ITUNESMEDIATYPE tagged as "Music Video"
  2. MP3 will get it's MEDIATYPE/ITUNESMEDIATYPE tagged as blank (delete or clear any assignment already in place)

This is beyond my knowledge which is HIGHLY limited. And advice?

Many thanks,
Lee

Did you have a look at this thread:


It looks as though there are many more types for mediatype:
Movie, Normal, Audiobook, Music Video, Short Film, TV Show, Ringtone

And: these categories are only valid for MP4 files anyway (which in a way has been indicated by you as you want to delete the field from mp3s)
You could create an action of the type "Format value" for MEDIATYPE
Format string: $ifgreater($strstr(%_tag%,MP4),0,Music Video,)

Thanks much ohrenkino. From what I can tell, that thread discussed how to do it manually, which I've been doing for a while now. Trying to automatically do it. I used your string suggestion (format value, mediatype, string $ifgreater($strstr(%_tag%,MP4),0,Music Video,) and it simply changes it to BLANK even on mp4's. Also tried the string $ifgreater($strstr(%_extension%,mp4),0,Music Video,). Just getting BLANK on all mp4's.

with %_extension% you could specify e.g. m4v.
The function $strstr() is case sensitive.

I tried...
$ifgreater($strstr(%_tag%,MP4),0,Music Video,) and
$ifgreater($strstr(%_tag%,mp4),0,Music Video,)
Both force mp4's to blank.

I just tried it on my MP4s and it works like intended:
$ifgreater($strstr(%_tag%,MP4),0,Music Video,)
writes "Music Video" to MEDIATYPE.

Sorry. This DOES work. I was confusing/mixing MEDIATYPE and ITUNESMEDIATYPE. This does change as needed. Thank you ohrenkino.