Copy Filename without including file Extension

Started by Wranglerdave, October 23, 2018, 06:20:22 AM

Previous topic - Next topic

Wranglerdave

I copy the filename into the file Description and file Title of jpg files using the following command...
exiftool '-filename>title' '-filename>description' \downloads

This works well but I would like to copy the file name without the extension.  Is there a way to do this?

I am running a Mac Pro with Mohave and the latest EXIF Tool.

Thanks for any help you can provide.

Phil Harvey

There are a few ways to do this, but the example config file defines a BaseName tag that does just this:

exiftool -config example.config '-basename>title' '-basename>description' /downloads

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wranglerdave

Phil thanks for the quick response but when I run the command I get the following error...
Warning: No writable tags set from downloads/work/Test IMG_3573.jpg

Suggestions?  Thanks again.

Dave

Phil Harvey

Hi Dave,

Somehow the config file isn't getting loaded properly because the BaseName tag should always exist.

Do you get any errors/warnings about not being able to find example.config?  (It should be in the current working directory for the command I gave).

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wranglerdave

The only errors I get are the ones I showed in my previous note.  I can not find example.config on my Mac anywhere.

Dave

Phil Harvey

Hi Dave,

Are you on Windows by any chance?  If so, you should be using double quotes, not single quotes.

No, you said in your first post that you are Mac.  ... then why did you use a backslash in the first command you posted?

Anyway,  what does this command give?:

exiftool -config example.config -filename -basename "downloads/work/Test IMG_3573.jpg"

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wranglerdave

I am now getting an error message "Config file not found".

I use the backslash because if I don't I get an error "File not found - /downloads/work".

I am on a Mac.

Dave

Phil Harvey

Hi Dave,

On Mac, the usual downloads folder is ~/Downloads (note that ~ can not be quoted for it to be expanded to your home directory name).

So maybe put the config file on your Desktop and try this:

exiftool -config ~/Desktop/example.config -filename -basename ~/Downloads/work/"Test IMG_3573.jpg"

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wranglerdave

Phil I'd be happy to copy the example.config file to my desktop if I could find it on my Mac.  I just tried re-installing the EXIFTOOL and still no config file.

Dave

Phil Harvey

Hi Dave,

The example files only come in the full distribution, but you can get it separately from here.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Wranglerdave

Thank you for your patience and expert information.  Once I download the full version, I was able to successfully create the file name in the appropriate fields.

Thanks again.

Dave

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).