Run script from another

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Run script from another

Post by jacco van der Ven »

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
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Run script from another

Post by Richard Naninck »

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"
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Run script from another

Post by jacco van der Ven »

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
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Run script from another

Post by Richard Naninck »

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
jacco van der Ven
Senior Member
Posts: 136
Joined: Tue Oct 21, 2003 4:16 pm
Location: The Netherlands

Re: Run script from another

Post by jacco van der Ven »

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
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Re: Run script from another

Post by Richard Naninck »

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..
Post Reply