News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

File Path

Started by j99mac, July 07, 2014, 12:30:30 PM

Previous topic - Next topic

j99mac

I am writing a script to add artist Tag to images. I am trying to pass a veritable to the Add Artist Tag

echo
    echo "please enter the path of images: "
    read input_variable
    IMAGE_DIR="$IMAGE_PATH"

echo "Add_Artist"
exiftool "$IMAGE_PATH" −EXIF:Artist="'ARTIST'"

I get the fallowing error

Error: File not found -
    0 image files updated
    1 files weren't updated due to errors

How do I write the script to have a file path veritable?

Hayo Baan

Have you already tried moving the filename part to the end of the line? I'm quite sure that's it.

HTH,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

j99mac

I just tried this  exiftool −EXIF:Artist="'ARTIST'" "$IMAGE_PATH"
and got the error "No file specified". Is this how I would add the variable

Hayo Baan

Hmm, looks like the $IMAGE_PATH doesn't get the value you want.  Looking at your script I must say I can't see how you set it, so that's likely your problem.

What is read input_variable supposed to do? My .bat scripting is a bit rusty (work with the bash shell myself on a Mac now but have worked with windows .bat files extensively too), but I don't think that's how you read your $IMAGE_PATH variable...
Hayo Baan – Photography
Web: www.hayobaan.nl

Phil Harvey

Also, you must use a simple ASCII dash before the exiftool options.  "-", not "−".

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