LOGIN  |  REGISTER
Smart Living Made Brilliant!
CASTLEOS FORUM

HomeScripting

A forum for information about scripting with CastleOS. Get samples, suggestions, and other help here

CastleOS and VB script Messages in this topic - RSS

Frank Dracman
Frank Dracman
Posts: 194


11/8/2015
Frank Dracman
Frank Dracman
Posts: 194
Does anyone know how we can call a vbscript from castleos. I'm looking to call a script when an event triggers.
An example would be much appreciated.
0 link
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3350


11/8/2015
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3350
0 link
Frank Dracman
Frank Dracman
Posts: 194


11/9/2015
Frank Dracman
Frank Dracman
Posts: 194
Thanks Chris.
0 link
Frank Dracman
Frank Dracman
Posts: 194


11/9/2015
Frank Dracman
Frank Dracman
Posts: 194
So, here is what i have put together based on the example provided earlier. But i got defining silence when the event is triggered. I can confirm that if i trigger the vb script manually it does produce the results i am looking for which is speech. Also i do not see the event being triggered in the log


Process scriptProc = new Process();
scriptProc.StartInfo.FileName = @"C:\ProgramData\CastleOS\CastleOS Core Service\Scripts\frontPorch.vbs";
scriptProc.Start();
scriptProc.WaitForExit();
scriptProc.Close();


-----------------------------------------

here is the content of the VB script:


dim speechobject
set speechobject=createobject("sapi.spvoice")
speechobject.speak "Excuse me, The front porch sensor has detected motion."
edited by boyakaa on 11/9/2015
0 link
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3350


11/9/2015
Chris Cicchitelli
Chris Cicchitelli
Administrator
Posts: 3350
Do you have the script running outside CastleOS? Again, you shouldn't be debugging in CastleOS, once it's fully running, you can then import the script..
0 link