So I currently have a script where I want to copy some metadata from one music file to another:
# Copy almost all tag 2 fields from the from file to the to file
kid3-cli -c "select $fromFile" -c "set '*.selected' 1" -c "set 'acoustid fingerprint.selected' 0" -c "set 'acoustid id.selected' 0" -c "set 'isrc.selected' 0" -c "set 'musicbrainz album id.selected' 0" -c "set 'musicbrainz album status.selected' 0" -c "set 'musicbrainz album type.selected' 0" -c "set 'musicbrainz work id.selected' 0" -c "copy" -c "select $toFile" -c "paste"
$fromFile
and $toFile
are just paths to the music files.
The issue I have is that if I try to set say isrc.selected
to 0 but it doesn’t exist, the command will fail and the subsequent commands won’t go though.
Is there any easy way to just deselect a tag if it exists and then skip it if it doesn’t exist? I am trying to avoid doing a for loop through multiple tags and checking them and storing them in a variable to check if they’re empty and then setting the selection to 0 if it exists.