Exiftool with YAD on Linux

Started by rodertroy, October 23, 2015, 11:20:54 PM

Previous topic - Next topic

rodertroy

I created the following bash script for use with YAD (yet another dialog). It's for adding certain metadata for uploading images to Flickr. Can be used with Thunar Custom Actions. I posted a tutorial on my blog: https://birchwell.github.io/posts/thunar-custom-action-exiftool-add-metadata/



Bash Script:

#!/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" $@

Phil Harvey

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

rodertroy

Sure! I had help with it from the YAD Google Group: https://groups.google.com/forum/?hl=en#!topic/yad-common/t2Nov5_3yzA.