#!/bin/csh -f # editcaptions # ------------------------------------------------------------------------- # Shell script to create and edit caption files for a picture album # ------------------------------------------------------------------------- # Revision History: # $Log$ # ------------------------------------------------------------------------- if (`find . -name "*.[Jj][Pp][Gg]" -print` != "") then # Create TXT file for each JPG, so we can load them all into the editor # at the same time. foreach image_file (*.[jJ][pP][gG] *.[gG][iI][fF] *.[pP][nN][gG]) set txt_file = "${image_file:r}.txt" # Note: Don't touch it if already exists. Changing the timestamp # causes it to be unnecessarily re-published to the server. if (! -e $txt_file:q) then touch $txt_file:q endif end # Edit all the TXT files, waiting till the editor exits. ew *.txt # Delete any that are still empty foreach txt_file (*.txt) if (-z $txt_file:q) then rm $txt_file:q endif end if ("$1" != "-q") then # Pass along command line arge/options like -l makealbum -q -r $*:q slideshow open $*:q endif endif