script - Slideshow in Rev using one page

Jim Ault jimaultwins at
Tue Dec 22 13:17:14 EST 2009

This uses
    <meta HTTP-EQUIV='refresh' CONTENT='10; URL=
tag to tell the browser to refresh after 10 seconds
and what url to send.

----------start here-----------
<html xmlns=''>
<title>Demo of Sequential Slide Show Using a Param<?title>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />

# using (html & javascript)-legal single quotes makes things easier
put "slideShowParams" into thisPageName
get "<meta HTTP-EQUIV='refresh' CONTENT='10; URL="
get IT & thisPageName
get IT & ".irev?pImageNum=zNextImgNumberz'>"
put IT into refreshTag --keep this string for later

#Jacque's lists of copyrighted images (7)
         get "vinca.jpg thistleFluff.jpg pinkHoneysuckle2.jpg"
         get IT && "milkweed2.jpg lamiumClose2.jpg cosmos2.jpg  
         put IT into imageList

put $_GET["pImageNum"] into pImageNum
put "new $_GET[ pImageNum ]  equals " & pImageNum

#detect conditions and react
     if pImageNum is not a number then put 1 into pImageNum
catch errnum
     put 1 into pImageNum
end try
get the number of words in imageList
if pImageNum > IT then
    put 1 into pImageNum
end if
put word pImageNum of imageList into tFlower --for this page
put pImageNum + 1 into nextImgNumber  --for next time
replace "zNextImgNumberz" with nextImgNumber in refreshTag
put refreshTag --write this line in the head section
     <div > <p>Seven of  Jacque's copyrighted images in sequence  
             <img src='<?rev  put tFlower ?> ' width='320'  
height='240' border='1' />
<?rev put "(this, next) equals.. (" & pImageNum &", " && nextImgNumber  
& ")" ?>


Working example running on a 10 second cycle.

Many variations possible.

Hope this helps someone.

Jim Ault
Las Vegas

More information about the Use-livecode mailing list