News:

If you have an Android device, check out VoxWav!

Main Menu

Playload question

Started by Sieg, July 30, 2013, 05:25:17 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Sieg

Hi,

In first, thank you for this wonderful software, i can't do without.
Secondly, sorry for my english, I'm french. ;)

I  searched on the forum, but i did not find a solution to my prob.

I use AutoHotKey to generate a PlayloadXml file dynamically, I use it for monitor some folders and some windows.
VoxCommando understand the change only after a quick restart, but this is too heavy for something of dynamic.
For this reason, I'm looking for a way to refresh the command list without to do a quick restart.

I don't know if it's possible with voxcommando or by an other way.

Anyway thank you for reading. ;)

jitterjames

#1
Hi Sieg,

Currently there is no other way.  How often do you need to update this file?

There is an action to do the restart (you probably already know this): VC.RestartQuick

On the File Menu you can use "Build Missing Grammars".  This won't reload the grammar but it will make sure that it is compiled and ready to load next time VC is restarted (either quick or full).

I get excited when I see people really using the program in new ways, so I'm happy to see your question.  I would love to know more about what you are doing and why.

I understand your English well so far. Feel free to post in English or French, as you prefer.  We can use google translate to read your post.

It is probably possible for me to create something in a future version that would allow us to update and reload only one grammar (or any new grammars).  Currently we reload all grammars and commands on a restart to avoid the possibility of "weirdness".  Usually it is still pretty quick though since the grammars (groups) are precompiled and stored in the srgs folder.

Welcome to the community.

nime5ter

#2
Quote from: Sieg on July 30, 2013, 05:25:17 PM
Secondly, sorry for my english, I'm french. ;)

Salut, Sieg, et bienvenue chez le forum de VoxCommando. Je pense que nous comprenons assez bien le français, si tu veux poser les questions ou participer au forum en français (au moins pour obtenir l'aide avec des problèmes qui sont plus difficile à décrire).

Pour la plupart nous allons répondre en anglais pour que nous puissions donner une réponse précise et bien composée. D'écrire en français ce n'est pas si facile. ;)
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)

Sieg

#3
Quote from: nime5ter on July 30, 2013, 09:08:32 PMD'écrire en français ce n'est pas si facile. ;)

Héhé , merci. ;)

Quote from: jitterjames on July 30, 2013, 07:01:41 PM
I understand your English well so far. Feel free to post in English or French, as you prefer.
Thanks too. :)

Quote from: jitterjames on July 30, 2013, 07:01:41 PMI get excited when I see people really using the program in new ways, so I'm happy to see your question.  I would love to know more about what you are doing and why.

Well, I use 3 AHK scripts to generate payloadsXml :

* I use EventGhost with DirectoryWatcher, to Monitor the StartMenu folder, each change triggers my ahk script to generate a new xml file with the list of each shortcut in the folder. (just for the exe, and directories)
==> Launch

* For my second ahk script, whenever a task is created or destroyed, EventGhost triggers my script to create a list of every program who is running, and it create the playloadXml.
  ==> Focus, Close, Desactivate/Activate the associated Groups in VoxCommando

*My last script is a work in progress, it will spy my programs and windows, and create a list of the controls for each one.
(And maybe scan all the menu of a program, the first time, and create a playloadXml dedicated)



Thank you both of you for your quick answer. ;)

jitterjames

Sounds pretty cool.  I'd like to see those scripts if you care to share them with us.

I will look into adding a better way to update grammars and let you know if it is possible in an upcoming version.  If you don't hear anything about it in the next month, feel free to remind me!

Sieg

#5
Quote from: jitterjames on August 02, 2013, 12:22:02 PM
Sounds pretty cool.  I'd like to see those scripts if you care to share them with us.

I will look into adding a better way to update grammars and let you know if it is possible in an upcoming version.  If you don't hear anything about it in the next month, feel free to remind me!

Thanks :)


For my first ahk script :

#Include lib\xpath.ahk

ScanMePr(FolderP) {
Loop, %FolderP%, , 1  ; subfolders
{
FileGetShortcut, %A_LoopFileFullPath%, OutTarget
NomPr := RegExReplace(A_LoopFileName, "i).lnk$", "")
If ( || RegExMatch(OutTarget, "i).exe$") &&  !RegExMatch(OutTarget, "&")) {  ;des Exe, sans "&"
VOutput .= "<payload>`n<value>" . A_LoopFileFullPath . "</value>`n<phrase>" . NomPr . "</phrase>`n<subsetmatching>true</subsetmatching>`n</payload>`n"
}
else if (!RegExMatch(OutTarget, "\.")) { ; ou des dossiers
VOutput .= "<payload>`n<value>" . A_LoopFileFullPath . "</value>`n<phrase>Dossier " . NomPr . "</phrase>`n<subsetmatching>false</subsetmatching>`n</payload>`n"
}
}
Return %VOutput%
}


ExtW :="<<PayloadsRoot>"
ExtW .= ScanMePr(A_Programs . "\*.lnk")
ExtW .= ScanMePr(A_ProgramsCommon . "\*.lnk")
ExtW .= "</PayloadsRoot>"

IfExist, ../Xml/Launch.xml
FileDelete, ../Xml/Launch.xml

xpath_save(ByRef ExtW, "../Xml/Launch.xml")


The second :

#Include lib\xpath.ahk

ExtPR :="<<PayloadsRoot>"

WinGet, id, list,,, Program Manager
Loop, %id%
{
this_id := id%A_Index%
WinGet, Proc, ProcessName, ahk_id %this_id%,,
WinGetTitle, NamC, ahk_id %this_id%
NamP := RegExReplace(Proc, "i).exe$", "")

ExtPR .= "<payload>`n<value>" . NamP . "</value>`n<phrase>"
If(NamP=="explorer"){
ExtPR .=NamC
}
else{
ExtPR .=NamP
}
ExtPR .= "</phrase>`n<subsetmatching>true</subsetmatching>`n</payload>`n"
}

ExtPR .= "</PayloadsRoot>"

IfExist, ../Xml/Pactif.xml
FileDelete, ../Xml/Pactif.xml

xpath_save(ByRef ExtPR, "../Xml/Pactif.xml")


Voxcommando write & run a ahk script to focus or close the windows . ( I had some prob to do what I wanted with the process "explorer.exe", now I use the windows ID. ) :

<?xml version="1.0" encoding="utf-16"?>
<command id="342" name="Focus" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>File.WriteLine</cmdType>
    <cmdString>{Path.VC}\..\Ojib\Script\CVox.ahk&amp;&amp;WinActivate, ahk_id {1}</cmdString>    /* or  WinClose */
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.RawParam</cmdType>
    <cmdString>{Path.VC}\..\Ojib\Script\CVox.ahk</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <phrase>Switch, focus</phrase>
  <payloadFromXML phraseOnly="False" use2partPhrase="False" phraseConnector="by" Phrase2wildcard="anyone">E:\Prog\Ojib\Xml\Pactif.xml</payloadFromXML>
</command>



Xpath.ahk is a script from Polyethene


For my third script I'll wait to finish it, and I'll post it here, if you are already intrested .

jitterjames


Sieg

Hi,

I updated my second script and I'll doing something to include the process minimized in the tray.

Have fun ;)

GMib

Quote from: jitterjames on August 02, 2013, 12:22:02 PM
I will look into adding a better way to update grammars and let you know if it is possible in an upcoming version.  If you don't hear anything about it in the next month, feel free to remind me!

+1, need this too ;)