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

Windows username variable

Started by PegLegTV, January 17, 2016, 02:36:02 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

PegLegTV

nime5ter great tutorial,   :clap

I took a look at the commands and I noticed that in the command "5. Using payload XML in the macro, but not the voice command" you forget to change the file path

it reminded me that I wanted to make a feature request for a program variable for "Username" but forgot after I set it up using python

Var.username
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.2.1.4-->
<command id="1492" name="Var.username" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>PY.ExecString</cmdType>
    <params>
      <param>import getpass{CR}result=username = getpass.getuser()</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.SetVar</cmdType>
    <params>
      <param>username</param>
      <param>{LastResult}</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>VC.Loaded</event>
</command>


let me know if you want me to make a feature request

jitterjames

Quote from: PegLegTV on January 17, 2016, 02:36:02 AM

it reminded me that I wanted to make a feature request for a program variable for "Username" but forgot after I set it up using python


I don't think it would be used commonly enough to warrant being added to the variables but maybe I could add an action to retrieve it.

I'm just curious what you would use this for. I've never come across a situation where it would be useful and can't really think of any yet.

PegLegTV

I have VC Running on 3 different PC's but they all use the same Voicecommands.xml so I only need to update one of them,

I use the same folder structure on all pc's

but none of my PC's have the same username, I use it mainly for passing parameters and running my Autohotkey Scripts

Haddood

Quote from: jitterjames on January 18, 2016, 10:24:45 PM
I'm just curious what you would use this for. I've never come across a situation where it would be useful and can't really think of any yet.
one scenario, if you have multiple users on the same PC... VC can do different things based on the user, with one set of commands. ex; what is my dad phone? will return different numbers based on the user ... I do not have this scenario ... but it is possible
When Voice command gets tough, use hand gestures