Is it possible to run an script from another script.
example:
I have an script what can send an message to my iPhone, this is an function.
Now from another script where the trigger is I want to run the function in that other script to send it and use the variable(message) from the trigger script?
Is this possible and how?
Regards, Jacco
Run script from another
-
- Senior Member
- Posts: 136
- Joined: Tue Oct 21, 2003 4:16 pm
- Location: The Netherlands
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: Run script from another
Yes, no problem. If you use scripts that start and stop each run, this makes sense. You can also setup scripts with a Do - Loop construction looking for commands to work out. Many examples in the scripts department.
SetPropertyValue "Your Script Device.State", "Running"
SetPropertyValue "Your Script Device.State", "Running"
-
- Senior Member
- Posts: 136
- Joined: Tue Oct 21, 2003 4:16 pm
- Location: The Netherlands
Re: Run script from another
Thanks, Richard, this is also an good solution, but is it also possible from the vscript himself?
I have two scripts:
Motion.vbs and SendProwlMessage.vbs
What I want is to run SendProwlMessage.vbs from the motion script and not via Housebot.
so in Motion is the message variable that I will send with the SendProwlMessage.vbs script.
Jacco
I have two scripts:
Motion.vbs and SendProwlMessage.vbs
What I want is to run SendProwlMessage.vbs from the motion script and not via Housebot.
so in Motion is the message variable that I will send with the SendProwlMessage.vbs script.
Jacco
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: Run script from another
Well, that's exactly what I mean.
If your motion script wants to start the Sendmessage script just do something like this:
If motion = true then
SetPropertyValue "SendMessage Script Device.State", "Running"
End If
If your motion script wants to start the Sendmessage script just do something like this:
If motion = true then
SetPropertyValue "SendMessage Script Device.State", "Running"
End If
-
- Senior Member
- Posts: 136
- Joined: Tue Oct 21, 2003 4:16 pm
- Location: The Netherlands
Re: Run script from another
What I meaned is this code in the motion script, what you discribed run the second script with an script device in Housebot.
I want to do it directly in vbscript without Housebot.
Set objShell = CreateObject("WScript.Shell")
If Motion = "On" Then
Message = "Motion detected"
objShell.Run "C:\SendProwlMessage.vbs Message " & Message
Set objShell = Nothing
I want to do it directly in vbscript without Housebot.
Set objShell = CreateObject("WScript.Shell")
If Motion = "On" Then
Message = "Motion detected"
objShell.Run "C:\SendProwlMessage.vbs Message " & Message
Set objShell = Nothing
-
- HouseBot Guru Extraordinaire
- Posts: 1121
- Joined: Tue Sep 28, 2004 7:49 am
- Location: The Netherlands
Re: Run script from another
OK, I guess I misread you but I still don't really know what you mean. Did you fix it now with the example code you published?
If not and you still have questions, you could send me an email in Dutch and go from there..
If not and you still have questions, you could send me an email in Dutch and go from there..