ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: afranke on May 05, 2015, 05:20:20 AM

Title: On the fly shortcut tags
Post by: afranke on May 05, 2015, 05:20:20 AM
Hi,

I'd like to define a shortcut tag without having to create a config file first, directly on the command line. My goal is to have a portable command line which doesn't require installing a file first. Can this be done?

Alternatively, I'd like to suggest a new shortcut tag that would get integretad by default: AllTracks for Track, TrackNumber, maybe other similar fields.
Title: Re: On the fly shortcut tags
Post by: Phil Harvey on May 05, 2015, 06:42:25 AM
Defining a shortcut on the command line is simple:  Just specify the tags you want in the shortcut, ie)

exiftool -track -tracknumber ...  :)

or, you could use wildcards, like this:

exiftool "-*track*" ...

- Phil
Title: Re: On the fly shortcut tags
Post by: afranke on May 13, 2015, 03:07:37 AM
Thanks Phil. I'm not sure how that would work in the case of a renaming though.

I have a bunch of audio files with random names. I'm trying to rename and sort them so that they all look like Artist/Album/01_-_Track_title.ext
Some have a track field, some others have a tracknumber field.

What I have so far is:
exiftool -r -m '-filename<${TrackNumber;}_-_${Title;}%-c.%e' "-directory<$outdir/AUDIO/\${Artist;}/\${Album;}" $outdir/AUDIO -ext "*"
Title: Re: On the fly shortcut tags
Post by: afranke on May 13, 2015, 03:12:51 AM
One more detail:
I understand that if I do '-filename<${Track;}${TrackNumber;}_-_${Title;}%-c.%e' I will get whichever is present in the file, but I'm afraid there might be some files which have both and I only want the first one in these cases.
Title: Re: On the fly shortcut tags
Post by: Phil Harvey on May 13, 2015, 07:26:35 AM
What you want to do is really more suited to user-defined Composite tag, but can be achieved on the command line.

To ignore TrackNumber if Track exists, you could do this:

'${Track;}${TrackNumber;undef $_ if defined $self->GetValue("Track")}'

- Phil