#!/p/kd/fdc/solaris9/wermit # # Frank da Cruz, 28 February 2011 # # Given a directory that contains a bunch of directories that contain images, # this script creates a photo album Web page (index with thumbnails, with # access to the larger images) in each of the subdirectories. This is # hardcoded for making the Herb Grosch color-slide album but can easily be # parameterized or modified by changing the two assignments just below. # Requires C-Kermit 9.0. # .base = ~/timeline/grosch/ # Root directory on web server .prefix = "Herb Grosch: " # Prefix for full title define ermsg if fail exit 1 \v(lastcommand) cd \m(base) # CD to root directory ermsg # Check that we did dir /dir /array:&d * # Get directory names into array d[] .n := \fdim(&d) # n = dimension of array if < n 2 ermsg # There should be at least 2 echo Directories: \m(n) # Confirmation message for i 1 n 1 { # Loop through directories chmod 755 \m(base)\&d[i] # Make this directory readable ermsg # Check that we did cd \m(base)\&d[i] # CD to it ermsg # Check that we did echo "-------- \&d[i] --------" rename /lower:all * # Lowercase all filenames ermsg # Check that we did # Make photo album for this directory... # using the directory name itself as the title. !photoalbum "title=Herb Grosch: \m(prefix)\freplace(\&d[i],_,\32)" - "shorttitle=\freplace(\&d[i],_,\32)" }