--- In [email protected], theyal...@... wrote:
>
> I use to launch screensaver via Sheduler idle 00:02 element.
> For it not to cover running video-player I added this condition:
>
> *Script if (Not activewindow("c=CrystalPlayerClass") Or
> activewindow("c=LightAlloyFront") Or
> activewindow("c=WMPlayerApp") Or activewindow("c=QWidget") Or
> activewindow("c=obj_Form"))
>
> (QWidget is VLC
> obj_Form is ip-Tv player)
>
> Is there a way to put players list in a separate file?
>
What you want can be done in a script file.
Capture the class of the active window:
local classnow=win.class(win.handle("active"))
Instead of a separate file, put all of the classes into a vector as part of the
script file, e.g.:
local excwinclasses=vec.create(5)
excwinclasses[0]="CrystalPlayerClass"
excwinclasses[1]="LightAlloyFront"
excwinclasses[2]="WMPlayerApp"
excwinclasses[3]="QWidget" ;;QWidget is VLC
excwinclasses[4]="obj_Form" ;;obj_Form is ip-Tv player
Then pull them into a string that can be part of regular expression:
local playerlist=excwinclasses.makewords("|")
Then the following is equivalent to your existing "script if"
if (regex.pcrematch(?"(?i)^(?:"++playerlist++?")$", classnow)==0)
Basically says if the current class doesn't match one of the alternates.
> And, is there a way to launch screensavers sequentially in
> defined folders? (Not using PP' Media tab which uses one folder
> only)
You can do that too, you could create a file that lists all the screensaver
files from the specified folders, and then sequence through them. When the
sequence number is greater than the number of lines in the file, start over.
The file could be created or recreated via script. Most likely you're not
adding new scr files very often, so maybe once created, it wouldn't need
recreating very often.
local allscrs
local cachefile=pprofolder++?"scrfiles.txt"
local scrdirs=vec.create(5)
scrdirs[0]=?"C:\Windows\System32" ;;add additional folders below
scrdirs[1]=?""
scrdirs[2]=?""
scrdirs[3]=?""
scrdirs[4]=?""
local allscrs
for each dir in scrdirs
allscrs++=file.listfiles(dir++?"\*.scr")
endfor
file.writeall(cachefile, allscrs)
To start the screensaver you could use:
Static Seq
Seq+=1
if (Seq > line(file.readall(cachefile), 0)
Seq=1
ScreenSaver.Changeto(line(file.readall(cachefile),seq))
ScreenSaver.Start
Let me know if you need help putting it all together.
Regards,
Sheri