On the fly shortcut tags

Started by afranke, May 05, 2015, 05:20:20 AM

Previous topic - Next topic

afranke

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.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

afranke

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 "*"

afranke

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.

Phil Harvey

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
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).