News:

HOT TIP! Commands and groups can be copied and pasted directly from your command editor to the forum, and vice versa. This makes sharing command XML on the forum much easier!

Main Menu

Close Browser after send URL

Started by Foggy, January 19, 2013, 12:53:39 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Foggy

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.

jitterjames

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>

Foggy

Super - That works.

Appreciate your help.

Best wishes.

Etrust

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

nime5ter

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. :)
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

Etrust