Skip to content

Instantly share code, notes, and snippets.

@Birchwell
Last active October 24, 2015 02:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Birchwell/8d8e4b8ca7722c28d193 to your computer and use it in GitHub Desktop.
Save Birchwell/8d8e4b8ca7722c28d193 to your computer and use it in GitHub Desktop.
This Exiftool bash script will allow the user to populate 18 YAD fields with metadata for images. Useful for uploading images to Flickr.
#!/bin/bash
exiftoolform=$(yad --title "ExifTool" --form --width=700 --columns=2 --field="Artist:" --field="Copyright:" --field="City:" --field="State:" --field="Country:" --field="Creator:" --field="Rights:" --field="By-line:" --field="Headline:" --field="Description:" --field="Keywords 1:" --field="Keywords 2:" --field="Keywords 3:" --field="Keywords 4:" --field="Keywords 5:" --field="Keywords 6:" --field="Keywords 7:" --field="Keywords 8:" "John Doe" "(c) 2015 John Doe" "Chicago" "Illinois" "United States" "John Doe" "(c) 2015 John Doe" "John Doe")
OldIFS="$IFS"; IFS='|' # Save the old IFS value to OldIFS and give the new value to IFS.
read ARTIST COPYRIGHT CITY STATE COUNTRY CREATOR RIGHTS BYLINE HEADLINE DESCRIPTION KEYWORDSONE KEYWORDSTWO KEYWORDSTHREE KEYWORDSFOUR KEYWORDSFIVE KEYWORDSSIX KEYWORDSSEVEN KEYWORDSEIGHT <<< "$exiftoolform"
IFS="$OldIFS" # Give IFS back its original value.
exiftool -artist="$ARTIST" -copyright="$COPYRIGHT" -city="$CITY" -state="$STATE" -country="$COUNTRY" -creator="$CREATOR" -rights="$RIGHTS" -byline="$BYLINE" -headline="$HEADLINE" -description="$DESCRIPTION" -keywords="$KEYWORDSONE" -keywords="$KEYWORDSTWO" -keywords="$KEYWORDSTHREE" -keywords="$KEYWORDSFOUR" -keywords="$KEYWORDSFIVE" -keywords="$KEYWORDSSIX" -keywords="$KEYWORDSSEVEN" -keywords="$KEYWORDSEIGHT" $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment