I am looking to find out if a tag is empty? How to do you you if to check if a tag is blank of have anything written in it
Try
exiftool -if "$TAG eq '' "
Replace TAG with the name of the tag you are checking.
How do I use this with artist
exiftool -if "$TAG eq '' "
Is this how I write the comand
exiftool -if "$artist eq '' " dir
Your quotes are wrong. It should be
exiftool -if "$artist eq ''" DIR
(on Windows)
or
exiftool -if '$artist eq ""' DIR
(on Mac/Linux)
This will check if the tag exists but the value is empty. If you want to also check if the tag doesn't exist, do this:
exiftool -if "not defined $artist or $artist eq ''" DIR
- Phil
would this be how I checked if this is add a value to eq "artist"' ?
exiftool -if '$artist eq "artist"' $input_variable
Yes. I think so. But I'm not clear on what you want to do, and what $input_variable represents.
- Phil
this is what I would like do
if the artist tag is empty then write to artist tag
for input_variable I want it to a file path
echo "Enter the file path"
read input_variable
exiftool -if '$artist eq ""' $input_variable
exit 0
See my response here (https://exiftool.org/forum/index.php?topic=10931.msg60192#msg60192)
I tried the command like this and it did not add me to the image iwth no artist
echo "Enter the file path"
read dir
exiftool -if '$artist eq ""' -artist="me" $dir
exit 0
This means that either Artist didn't exist in the file, or it didn't have a value of "".
- Phil
when I ran the command nothing happened or it did not write me to the artist feild.
I'm locking this thread because it is a duplicate of this one (https://exiftool.org/forum/index.php?topic=10931).
- Phil