this script should do it
it rotates the files listed in "source" and copies them to destination every time is is called.
put this into scheduled action / action /= server=execute script
click on compile to see if its drama is correct
then replace
sourceDir
source
destination with your settings
execute the schedule every 5 minutes
put the destination string into your touch page.
then every 5 minutes the png file will change.
hope this helps
Karl
there is very little error checking done, i.e. if source an destination exists...
- Code: Select all
## 2014/11/24
## Karl Wachs
## this script will rotate files copied to a destiantion file each time it is executed
## it uses a variable "fileCopySequence" to store the sequence number
## it is usefull if you like to eg roatate a png file on your itouch page.
## copy this into a scheduled action
## and replace the source and destination directories and files to be rotated with your settings
## you should set the repeat time in the schedule and also conditions to enable / disbale in the schedule setup
##
import shutil
sourceDir="/Users/karlwachs/Documents/INDIGOplotD/" # this is the source directory f the files to like to rotate
source=[
"new device-minute-S2.png" ## these are the files that should be rotated
,"new device-minute-S1.png"
,"new device-day-S2.png"
,"new device-day-S1.png"
]
destination= "/Users/karlwachs/Documents/INDIGOplotD/FileToShow.png" ## this is the destination filename use this in your itouch page
try:
seqNumber=0
indigo.variable.create("fileCopySequence")
except:
try:
seqNumber = int(indigo.variables["fileCopySequence"].value)
except:
seqNumber=0
if seqNumber <len(source)-1: seqNumber+=1
else: seqNumber=0
indigo.variable.updateValue("fileCopySequence",str(seqNumber))
shutil.copyfile(sourceDir+source[seqNumber], destination)