VoxCommando Forum

New Features and Feature Requests => Feature Requests => Topic started by: PegLegTV on January 17, 2016, 02:36:02 AM

Title: Windows username variable
Post by: PegLegTV on January 17, 2016, 02:36:02 AM
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
Title: Re: Windows username variable
Post by: jitterjames on January 18, 2016, 10:24:45 PM
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.
Title: Re: Windows username variable
Post by: PegLegTV on January 18, 2016, 10:51:25 PM
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
Title: Re: Windows username variable
Post by: Haddood on January 19, 2016, 11:37:46 PM
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