#!/bin/bash
# Script to tag images using ExifTool

# Check if at least one file is provided
if [ "$#" -eq 0 ]; then
    zenity --error --text="No files provided. Please provide at least one file."
    exit 1
fi

TAGS=$(zenity --entry --title="Tag Image" --text="Enter tags (comma-separated):")
if [ -n "$TAGS" ]; then
    for FILE in "$@"; do
        if [ -f "$FILE" ]; then
            exiv2 -M "set Iptc.Application2.Keywords $TAGS" "$FILE"
        else
            zenity --warning --text="File not found: $FILE"
        fi
    done
else
    zenity --warning --text="No tags entered."
fi

