Using Hazel to remove ID3 tags

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Using Hazel to remove ID3 tags Sun Oct 16, 2016 7:09 am • by bonn
I have been trying to get Hazel to remove ID3 tags (specifically the 'Genre' tag) on downloaded audio/mp3 files.

I've tried a few approaches, including AppleScripts and Automator, but haven't yet found a working solution.

First off, I noticed that there is a "Remove tags" action in Hazel. If I select it, and select "Dynamic Tag", there is in fact a "Music Genre" attribute under "Other". I've tried it, and I'm assuming it's really just for macOS tags and not ID3 tags – correct?

Secondly, when looking for AppleScripts to achieve removal of ID3 tags, I have been unable to find anything that manages to do this without having to open iTunes, select the song, and remove the tag there via automated actions. This seems very complex and I'm not sure if it's possible to make it work via Hazel. I may be missing something here - is there a way to do it "natively" in macOS via AppleScript without the involvement of iTunes?

Lastly, I've tried to do this in Hazel via an Automator workflow. However, I haven't been able to figure out how to pass Hazel's processed files over to "Get Specified iTunes items" which I'm assuming is needed as a prerequisite before the song can be edited:

Image

The way I understand it, the equivalent to pass Hazel's files to Automator would be the function "Get Specified Finder Items", but I'm not sure if Finder items can be "passed" to iTunes.

Appreciate any help!
bonn
 
Posts: 12
Joined: Sun Oct 16, 2016 5:18 am

Re: Using Hazel to remove ID3 tags Mon Oct 17, 2016 10:56 am • by Mr_Noodle
The various tags functions in Hazel have nothing to do with id3 tags so those won't help you here.

Using either AppleScript or Automator to interface with iTunes will bring up iTunes to do the work. If you don't want that, then you need to look for a commandline program which will edit the tags in the file directly.
Mr_Noodle
Site Admin
 
Posts: 11872
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Using Hazel to remove ID3 tags Thu Dec 22, 2016 8:50 am • by neilmcgillivray
The Commandline Utility you probably need is 'id3edcmd'

It's part of the software 'ID3 Editor' by pa-software

Code: Select all
ID3 Editor version: 1.23.34 (1.15.68.298)

Usage: id3edcmd [options] file [file]...

Version 2 tag information:
    -tr number           Set the track number
    -ts number           Set the number of tracks
    -ti utext            Set the title/songname/content description
    -ar utext            Set the lead artist(s)/performer(s)/soloist(s)
    -al utext            Set the album/movie/show title
    -yr text             Set the year of the recording
    -gn utext            Set the genre or content type
    -co utext            Set the comments (use \\ for a backslash, \t for a tab
                         and \r \n for a line break)
    -cf file             Set the comments using a text file (can be UTF-8
                         and UTF-16)
    -cm utext            Set the name of the composer(s)
    -cp utext            Set a copyright message
    -oa utext            Set the original artist(s)/performer(s)
    -en text             Set the name of the person or organisation
                         that encoded the track
    -ur text             Set a URL link concerning the track
    -cl                  Add the compilation flag (iTunes use only)
    -im file             Add a picture file directly related to the track
                         (only JPEG/TIFF/PNG/GIF formats are supported)
    -ir file             Replace the current images with the picture file
                         (only JPEG/TIFF/PNG/GIF formats are supported)
    -ls utext            Set the lyrics or text transcription
    -ly file             Set the lyrics or text transcription using a text
                         file (can be UTF-8 and UTF-16)
    -cn utext            Set the name of the conductor
    -lr utext            Set the writer(s) of the text or lyrics
    -pb utext            Set the name of the label or publisher
    -or utext            Set the band/orchestra/accompaniment
                         (this is shown as 'Album Artist' in iTunes)
    -ct utext            Set the content group description
    -sb utext            Set the subtitle/Description refinement
    -es utext            Set the software/Hardware and settings used
                         for encoding
    -sn number           Set the set number
    -ss number           Set the number of sets
                         (this is shown as 'Disk Number' in iTunes)
    -is text             International Standard Recording Code (ISRC)
    -rc text             Timestamp describing when the audio was first
                         recorded (e.g. yyyy-MM-dd HH:mm:ss)
    -rl text             Timestamp describing when the audio was first
                         released (e.g. yyyy-MM-dd HH:mm:ss)
    -ik text             Initial musical key in which the sound starts
    -bm number           Beats per minute in the main part of the audio
    -uf owner id         Set the unique file identifier using an owner string
                         such as a URL and an id (up to 64 characters)
    -vn version          Set the version number to use (2.3 or 2.4)
                         Note: Auto is used without this option
    -au text             Set the artist URL link
    -ad number           Advisory setting 0 = none, 1 = explicit, 2 = clean
    -mo text             Mood e.g. 'Romantic' or 'Sad'
    -pn text             Produced notice (Performing Rights Organization)
    -iw text             ISWC (International Standard Musical Work Code)

Version 1 tag information:
    -n  number           Set the track number (0-255)
    -t  text             Set the track title
    -a  text             Set the artist
    -b  text             Set the album
    -y  number           Set the year of the recording (as a four digit
                         number)
    -c  text             Set a short comment
    -g  number           Set the genre ID (as a two digit number)

Podcast information:
    -pcon                Marks the track as a podcast
    -pcof                Removes the podcast mark from the track
    -pcid  utext         Set the podcast ID
    -pcfd  text          Set the podcast feed
    -pcds  utext         Set the podcast description

MPEG information:
    -mlen                Show the length of the track in seconds
    -mbtr                Show the bit rate in bps
    -mfrq                Show the frequency in Hz
    -mchn                Show the number of channels 1=Mono, 2=Stereo,
                         3=Multi, 4=Unknown

Miscellaneous:
    -out file            Instead of updating the input file, save to file
    -d                   Display the tracks tags details
    -m [novbr]           Display the track information (ignoring VBR if novbr
                         is also added and speed is required)
    -imd                 Display tag images type and size
    -import file         Load tag data from a file (.mp3 or .tdf) into the
                         tracks
    -export file         Save tag data from a track to a file
    -csv file [v]        Save tag data as a CSV file
    -xml file [noimg] [v] Save tag data as an XML file (ignoring images if
                         noimg is also added)
                         Note: If v is set to 1 the CSV or XML will be retricted
                         to a previous version for compatability
    -imex file [all]     Save the first tag image to file (if all is added
                         save all images present using file with added numbers)
                         Note: If 'file' is a folder the image(s) will be
                         exported using the default name e.g. Picture.jpg
    -folder              Create a track folder based on the album and
                         artist and move the file into the folder
    -rename [utf8] [format]
                         Rename the updated track using the title and track
                         (using UTF-8 if utf8 is added)
                         If format is used it must only use the options:
                         %A artist, %L album, %T title, %N track and %Y year
    -rmape               Remove an APE tag
    -rm1                 Remove V1 tags
    -rm2                 Remove V2 tags
    -rim                 Remove any existing images
    -rly                 Remove any existing lyrics
    -check [fix]         Check a track for errors and inconsistencies in the
                         MPEG stream (and attempt to fix)
                         Note: Fixing errors may remove the ID3v2 tag
    -e                   Do not process the next track if an error occurs
    -trash               When updating, the original track is moved to the
                         trash (even if it is across a network)
    -v1v2                Copy the V1 tag to V2
    -v2v1                Copy the V2 tag to V1
    -kd                  Keep the file dates the same after updating
    -trim                Remove whitespace from the beginning and end of the
                         text fields
    -tagtype number      Set the way tag fields are replaced, 0 = Replace
                         existing fields (default if not used), 1 = supported
                         fields only, 2 = all valid fields
    -pref file           Load preferences from this file including the license
                         (Mac only)
    -v                   Verbose mode
    -ver                 Display the product version
    -h                   Display Help / Usage

Where text can be in 8 bit ISO-8859-1 (Latin 1) format or 7 bit ASCII and
utext can also be in UTF-8 for Unicode support.
File names can also be in UTF-8 format if supported by the operating system.
Note: The ID3 V1 standard does not support Unicode.

To delete a tag field add an extra '-' to the argument, for example
'-ti "A title"' would add the title and '--ti' would delete the title.
Note: The delete option is only available for V1, V2 and Podcast fields and
does not include cf, cl, im, ir, ly, es, vn, pcon or pcof.
neilmcgillivray
 
Posts: 7
Joined: Tue Aug 16, 2016 8:02 am


Return to Support