Author Topic: Windows username variable  (Read 1449 times)

0 Members and 1 Guest are viewing this topic.

PegLegTV

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Windows username variable
« 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
Code: [Select]
<?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

  • Administrator
  • Hero Member
  • *****
  • Posts: 7713
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Windows username variable
« Reply #1 on: January 18, 2016, 10:24:45 PM »

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

  • $upporter
  • Sr. Member
  • *****
  • Posts: 499
  • Karma: 43
    • View Profile
Re: Windows username variable
« Reply #2 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

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Windows username variable
« Reply #3 on: January 19, 2016, 11:37:46 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