Author Topic: Playload question  (Read 3045 times)

0 Members and 2 Guests are viewing this topic.

Sieg

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Playload question
« on: July 30, 2013, 05:25:17 PM »
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

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Playload question
« Reply #1 on: July 30, 2013, 07:01:41 PM »
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.
« Last Edit: July 30, 2013, 07:04:11 PM by jitterjames »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 1999
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: Playload question
« Reply #2 on: July 30, 2013, 09:08:32 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. ;)
« Last Edit: July 30, 2013, 09:24:41 PM by nime5ter »
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

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Playload question
« Reply #3 on: July 31, 2013, 01:28:07 PM »
D'écrire en français ce n'est pas si facile. ;)

Héhé , merci. ;)

I understand your English well so far. Feel free to post in English or French, as you prefer.
Thanks too. :)

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.

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. ;)
« Last Edit: July 31, 2013, 01:30:15 PM by Sieg »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Playload question
« Reply #4 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!

Sieg

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Playload question
« Reply #5 on: August 03, 2013, 10:38:54 AM »
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 :
Code: [Select]
#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 :
Code: [Select]
#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. ) :
Code: [Select]
<?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 .
« Last Edit: August 06, 2013, 03:25:03 PM by Sieg »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Playload question
« Reply #6 on: August 03, 2013, 11:04:04 AM »
Thanks!

Sieg

  • Jr. Member
  • **
  • Posts: 7
  • Karma: 0
    • View Profile
Re: Playload question
« Reply #7 on: August 06, 2013, 03:30:31 PM »
Hi,

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

Have fun ;)

GMib

  • Jr. Member
  • **
  • Posts: 26
  • Karma: 0
    • View Profile
Re: Playload question
« Reply #8 on: September 18, 2013, 09:36:39 AM »
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 ;)