VoxCommando Forum

Help and Support (Using VoxCommando) => VoxCommando Basics and Core Features => Topic started by: Foggy on January 19, 2013, 12:53:39 PM

Title: Close Browser after send URL
Post by: Foggy on January 19, 2013, 12:53:39 PM
Hi All,

I am trying to send a url that switches on my lights and then close the browser.

Switching on my lights works - but for the life of me I can't then close the browser.

<?xml version="1.0" encoding="utf-16"?>
<command id="249" name="Lights On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Launch.OpenURL</cmdType>
    <cmdString>http://192.168.0.112/lightwaverf.php?room=living&amp;device=socket&amp;state=on</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Window.Close</cmdType>
    <cmdString>firefox</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Enable Standing Light</phrase>
</command>


Can any one tell me what I am doing wrong.

Best wishes.
Title: Re: Close Browser after send URL
Post by: jitterjames on January 19, 2013, 01:43:42 PM
I suspect that you are trying to close the window before it has a chance to open.  I don't think the Launch command waits for the web page to load or anything like that, before moving on to the next action.

I suggest that you use the scrape command instead, so you won't need to worry about opening a browser at all, and it will be much faster.  Plus if you happen to be using firefox at the time you don't have to worry about firefox closing when you want to turn the lights on!

Try this:

<?xml version="1.0" encoding="utf-16"?>
<command id="249" name="Lights On" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Scrape</cmdType>
    <cmdString>http://192.168.0.112/lightwaverf.php?room=living&amp;device=socket&amp;state=on</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Enable Standing Light</phrase>
</command>
Title: Re: Close Browser after send URL
Post by: Foggy on January 19, 2013, 02:03:52 PM
Super - That works.

Appreciate your help.

Best wishes.
Title: Re: Close Browser after send URL
Post by: Etrust on November 14, 2014, 03:17:57 PM
Hi Guys,

I am using the stable version 2.0.

I want to use this code from james. How can I use it exactly? I think I have to save as xml and change my url of course. But how to load this xml to a command exactly??

Please help! I am loving voxcommando and will buy this week after my tests.

Best regards
Title: Re: Close Browser after send URL
Post by: nime5ter on November 14, 2014, 03:44:56 PM
Welcome eTrust.

Looks like you've missed a very important wiki page! http://voxcommando.com/mediawiki/index.php?title=XML_on_the_forum

Knowing how to copy and paste xml into your command tree will make the forum posts a lot more useful. :)
Title: Re: Close Browser after send URL
Post by: Etrust on November 15, 2014, 06:29:54 AM
oh yes thank you very much!!!