#!/bin/sh ## ## Nautilus ## SCRIPT: htm00_multi-img-files_imgsDownHTMLpage_addTextPerImg_echo_for-loop.sh ## ## PURPOSE: Generate an HTML file showing image files down the page, ## in table cells, one cell per row, using the selected image files ## --- '.jpg', '.png', '.gif' or whatever. ## ## METHOD: Uses 'echo' to generate the lines of the HTML output file. ## ## Shows the HTML file in an html-viewer of the user's choice ## ($HTMLVIEWER), and puts the user in edit mode on the HTML file ## using a text-editor of the user's choice ($TEXTEDITOR). ## ## ## HOW TO USE: In Nautilus, select one or more image files in a directory. ## Then right-click and select this script to run (name above). ## ## This script puts the '.htm' HTML file in the directory ## with the image files. ## ############################################################################ ## Started: 2009aug18 ## Updated: 2010jul21 ## Updated: 2011apr12 Converted to a Nautilus script, to gather selected files. ## Changed: 2011may11 Get 'nautilus-scripts' directory via an include script. ## Changed: 2011jul07 Changed to handle filenames with embedded spaces. ## (Removed use of FILENAMES var and use a 'for' loop ## WITHOUT the 'in' phrase. Ref: man bash ) ## Changed: 2012may14 Changed script name in comments above and touched up ## the comments. Changed some indenting below. ## Changed: 2013may30 Moved sample text above images to below images. ## Changed: 2013oct20 Added '_addTextPerImg' to script name. ########################################################################### ## FOR TESTING: (show statements as they execute) # set -x ################################### ## Set the htm output file name. ################################### HTMFILE="00_temp_imgCells_downPage.htm" # HTMFILE="temp.htm" if test -f "$HTMFILE" then rm "$HTMFILE" fi ####################################### ## Put the 'head', 'title', and 'intro' ## sections in the HTML file. ####################################### echo "
|
Title Goes Heresubtitle goes here |
|
A few more notes or links may be added.
Introduction :
|
START of IMAGES :
$RULELINE
Description of image below goes here.
|
Bottom of the Title Goes Here page.
To return to a previously visited web page location, click on the
< Go to Start of Images, above. >
|
" >> "$HTMFILE"
###################################
## SHOW HTML FILE in a web browser.
###################################
## . $HOME/.gnome2/nautilus-scripts/.set_VIEWERvars.shi
. $HOME/.freedomenv/feNautilusScripts/set_DIR_NautilusScripts.shi
. $DIR_NautilusScripts/.set_VIEWERvars.shi
$HTMLVIEWER "$HTMFILE" &
##################################
## Put HTML FILE in a text editor.
##################################
$TEXTEDITOR "$HTMFILE"