Kodi Community Forum
external "srt" subtitle check using script.embuary.helper - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Skinning (https://forum.kodi.tv/forumdisplay.php?fid=12)
+--- Thread: external "srt" subtitle check using script.embuary.helper (/showthread.php?tid=365133)



external "srt" subtitle check using script.embuary.helper - kenmoon - 2021-10-26

Can I check the external subtitle file with script.embuary.helper?

https://github.com/sualfred/script.embuary.helper/wiki/Script:-Actions-and-helpers#check-if-file-exists
////
Returns true if file exists. Otherwise the window property is going to be cleared.
Arguments
file= (required)
prop= (optional, default is "FileExists")
Example
RunScript(script.embuary.helper,action=lookforfile,file='"C:\install.log"',prop=MyProp)
Result
Window(home).Property(MyProp) = true or empty
////

I want to make label for the external subtitle file (movie.srt or movie.smi in same folder in movie file). What should I do if the above script can check the external subtitle file?
This is my test code
xml:

<onload>RunScript(script.embuary.helper,action=lookforfile,file='IDONTKNOW',prop=MyProp)</onload>
I guess IDONTKNOW  may be,, $INFO[container(903).ListItem.Filenameandpath]
903: my view container id, but, how to give "srt" string on it? My trial,it does not work - $INFO[container(903).ListItem.Filenameandpath].srt

I will use this label for check subtitle file.
...
<control type="label">
<label >It has Subtitile</label>
<visible>!IsEmpty(Window(Home).Property(MyProp))</visible>
</control>

<control type="label">
<label >It has NOT Subtitile</label>
<visible>IsEmpty(Window(Home).Property(MyProp))</visible>
</control>