How to set many of the same keywords in one click.

Started by dclecar, September 11, 2012, 07:11:32 AM

Previous topic - Next topic

dclecar

Hi all! Sorry, I'm a newbie. I have the following problem. I often write the same value in all of the key words. That's it:

-usercomment = "Moscow City" -comment = "Moscow City" -exif: imagedescription = "Moscow City" -iptc: caption-abstract = "Moscow City" -iptc: keywords = "Moscow City"

... and so on. How to do it easily with the help of a single variable. I would like to set many of the same keywords in one click. Is it real? I did not find the solution anywhere.

Phil Harvey

You can do this by creating an ExifTool user-defined shortcut tag.  Here is a config file that will do this:

%Image::ExifTool::UserDefined::Shortcuts = (
    MyComment => [
        'UserComment', 'Comment', 'EXIF:ImageDescription',
        'IPTC:Caption-Abstract', 'IPTC:Keywords',
    ],
);
1; # end


With this config file activated you should be able to write all of these tags by setting the value of MyComment (provided ExifToolGUI will let you write this tag, but I think you can add any tag to the Workspace, so hopefully this will work).

- 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 ($).

dclecar

Thanks, Phil!
But I've never had to deal with shortcuts tags. I read the FAQ, but did not understand. It's hard for me. I've always used just simple scripts in a .BAT file and short commands to ExifToolGUI. They work great and help me organize my photo archive!
Maybe I'm an idiot - I have tried to insert your code into the command line ExifToolGUI - it does not work. My version of the operating system WINDOWS 7. I replaced the single quotes to double quotes. It did not work.
At the moment, to set of the same keywords I use DOS command line variable. For this I created an additional .CMD file:

d:\My_Photoalbum \ ExifToolScript.bat "my keyword"

ExifToolScript.bat looks like this:

exiftool -charset exif=utf-8 -exif:imagedescription=%1 -exififd:usercomment=%1 -exif:xpkeywords=%1 -charset iptc=utf-8 -iptc:caption-abstract=%1 -xmp:description=%1 -xmp-dc:description=%1 -xmp-dc:subject=%1 -xmp-microsoft:lastkeywordxmp=%1 -xmp-microsoft:lastkeywordiptc=%1  -charset cp1251 d:\My_Photoalbum -k

It is not very convenient. But it works.
I understand that it is difficult to talk to me - I do not have deep knowledge in programming.  But perhaps there is a simple solution suitable for me?
Forgive me for my bad English - is Google translate. Evgeny.

Phil Harvey

I should have mentioned that the instructions for activating a config file are in the link I gave in my last post.  Name the file ".ExifTool_config" and put it in your home directory.  Unfortunately though generating a file name beginning with a "." is a bit tricky in Windows, but can be done from inside a cmd window. 

- 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 ($).

dclecar


dclecar

#5
I've tried, but unfortunately I was not able to adapt your code to the DOS command line. But I found out with the DOS environment variable! Here is a turned CMD:

set keyword="Moscow town"
exiftool -exif:ImageDescription=%keyword% -exififd:usercomment=%keyword% -IPTC:Caption-Abstract=%keyword% -xmp:description=%keyword% -k %*


Drag the image files on this CMD file and voila - "Moscow town" is written in all the fields that I noted! I am satisfied with the result!
In any case, thank you Phil! ExifTool - a great utility!
Evgeny.