[Windows Mobile Apps and Games] dagosjt:
Hello Micha,

here I am about WaPaC features inside CHTS.

In WaPaC thread you asked me "how is this triggered by the app?". Well, for me was never a problem, I mean I saw a new wallpaper everytime I started again the application :)

As said, in this moment I use my script for:

- PowerRadio background. it's a fixed path inside application, that is you have to overwrite the background.jpg image inside application path)

- G-Alarm background. You can choose the file inside G-Alarm configuration. Again I choose the file and script simply overwrite it. Difference with PowerRadio is jpg can be everywhere.

- Sense Sun/Moon/Clock images. They are group of files I've put in folders, in destination path I overwrite all the files inside this folder.

Configuration I use is:

[Folders]
BigImageP1=\Storage Card\Skin\Wad2\Wallpaper800_P|file|bigImage.jpg|0|0
BigImageP2=\Storage Card\Skin\Wad2\Wallpaper800_P|file|bigImage2.jpg|0|0
BigImageP3=\Storage Card\Skin\Wad2\Wallpaper800_P|file|bigImage3.jpg|0|0
BigImageP4=\Storage Card\Skin\Wad2\Wallpaper800_P|file|bigImage4.jpg|0|0
BigImageL1=\Storage Card\Skin\Wad2\Wallpaper800_L|file|bigImageL.jpg|0|0
AnalogClock=\Storage Card\Skin\Wad2\AnalogClocks\Clock190|file|AnalogClock\WadClock.png|0|0
LittleAnalogClock=\Program Files\Lakeridge\WisBar Advance Desktop\Themes\Filli_Common\Graphic\Clock64\|file|clockDock.png|0|0
MyImageP=\Storage Card\Foto\My Pictures\|file|myImageP.jpg|0|0
MyImageL=\Storage Card\Foto\My Pictures L\|file|myImageL.jpg|0|0
SmallImageP=\Storage Card\Foto\My Pictures\|file|smallImage.jpg|240|400
SmallImageL=\Storage Card\Foto\My Pictures L\|file|smallImage2.jpg|400|240
OthersBigP=\Storage Card\Skin\Wad2\Wallpaper800_P\Other|dir|othersBigP.jpg|0|0
OthersBigL=\Storage Card\Skin\Wad2\Wallpaper800_L\Other|dir|othersBigL.jpg|0|0
OthersSmallP=\Storage Card\Skin\Wad2\Wallpaper800_P\Other|dir|othersSmallP.jpg|240|400
OthersSmallL=\Storage Card\Skin\Wad2\Wallpaper800_L\Other|dir|othersSmallL.jpg|400|240
DigitalClock=\Storage Card\Skin\Wad2\DigitalClocks|folder|DigitalClock\Clock|0|0
BigAnalogClock=\Storage Card\Skin\Wad2\AnalogClocks\Clock250|folder|AnalogClock|0|0

And mortscript is:

# MortScript to randomly choose different files
# from different folders for different programs!
# Script Suite by dagosjt
# Initialization

script = SystemPath("ScriptPath") & "\" & SystemPath("ScriptName") & SystemPath("ScriptExt")
iniFile = SystemPath("ScriptPath") & "\..\" & "Properties.ini"

regRoot = IniRead( iniFile, "Registry", "RegRoot" )
regPath = IniRead( iniFile, "Registry", "RegPath" )

graphicsPath = IniRead( iniFile, "Images", "GraphicsPath" )
scriptsPath = IniRead( iniFile, "Images", "ScriptsPath" )
#time to wait in minutes
ChangeTime = IniRead( iniFile, "Images", "RefreshImagesTime" )

Removenotifications(script)

ForEach key,value in iniKeys ( iniFile,"Folders" )
sourcePath = Part(value,"|",1)
typePath = Part(value,"|",2)
destFile = Part(value,"|",3)
width = Part(value,"|",4)
height = Part(value,"|",5)
Call("UpdateFile",sourcePath ,typePath,graphicsPath,destFile,width,height,key)
EndForEach

Call("UpdateFile","\Storage Card\Skin\Wad2\Wallpaper800_P","file","\Program Files\PowerRadio\Skin_Dusk_Black_Glow\","black.jpg",0,0,"PowerRadio")
Call("UpdateFile","\Storage Card\Skin\Cookie\Analog","folder","\Windows","",0,0,"CookieAnalog")
Call("UpdateFile","\Storage Card\Skin\Cookie\Moon","folder","\Windows","",0,0,"CookieMoon")
Call("UpdateFile","\Storage Card\Skin\Cookie\Sun","folder","\Windows","",0,0,"CookieSun")
Call("UpdateFile","\Storage Card\Skin\Wad2\Wallpaper800_P","file","\My Documents\My Wallpapers\","MaxManilaP.jpg",0,0,"MaxManilaP")
Call("UpdateFile","\Storage Card\Skin\Wad2\Wallpaper800_L","file","\My Documents\My Wallpapers\","MaxManilaL.jpg",0,0,"MaxManilaL")

#Wait for at time with a few extra seconds for next randomization
RunAt(timestamp() + 60*ChangeTime,script)

#SleepMessage(3,"Updated graphical files")
Exit

Sub UpdateFile

sourcePath = argv[1]
typePath = argv[2]
destPath = argv[3]
fileName = argv[4]
widthImg = argv[5]
heightImg = argv[6]
dirPath = argv[7]

if (typePath eq "folder")
#message("Folder "&sourcePath)
CallFunction("chooseRandomFile", chosenDir, sourcePath & "\*","dir")
chosenDir = chosenDir & "\*"
#message(chosenDir&" , "&destPath&fileName)
ForEach elementfile in files {chosenDir}
#message(elementfile&" , "&destPath&fileName)
pathArray = Split(elementfile,"\" )
lastElement = MaxIndex( pathArray )
#message(pathArray[lastElement])
copy(elementFile,destPath&fileName&"\"&pathArray[lastElement],1)
EndForEach
exitSub
#Message(widthImg&" "&heightImg)
ElseIf (typePath eq "dir")
CallFunction("chooseRandomFile", chosenDir, sourcePath & "\*","dir")
else
chosenDir = sourcePath
endif
RegWriteString(regRoot, regPath & "\ImagesPath\", dirPath, chosenDir)

#Message("Path is now " & chosenDir & ".")
CallFunction("chooseRandomFile", chosenFile, chosenDir & "\*","file", dirPath)
#Message("Chosen file is now " & chosenFile & ".")

copy(chosenFile,destPath & fileName,1)
if (widthImg > 0)
#Message("Resizing " & destPath & fileName & " to " & widthImg & " - " & heightImg)
#Message(" -input """ & destPath & fileName & """ -width " & widthImg & " -height " & heightImg)
Run(SystemPath("ScriptPath") & "\" & "ImgResize.exe"," -oldNaming -input """ & destPath & fileName & """ -width " & widthImg & " -height " & heightImg)
endif
EndSub

Sub chooseRandomFile

#Message("Choose random " & argv[2] & " in " & argv[1] & ".")
i=1
logicalDirName = argv[3]
if (argv[2] eq "file")
ForEach elementfile in files {argv[1]}
array[i]=elementfile
i=i+1
EndForEach
elseIf (argv[2] eq "dir")
ForEach elementdir in directories {argv[1]}
array[i]=elementdir
i=i+1
EndForEach
EndIf

n=MaxIndex(array)
x=timestamp()
tp=substr(x,9,2)
z=substr(tp,2,1) & substr(tp,1,1)
r=z*n/100
y=part (r,".",1)+1
randomelement = array[y]
#Message("Chosen random element is " & %randomelement% & ".")
RegWriteString(regRoot, regPath & "\ImagesPath\", logicalDirName&"current", y)
RegWriteString(regRoot, regPath & "\ImagesPath\", logicalDirName&"max", n)

Clear(array)
return (randomelement)

EndSub

For every doubt feel free to write me.