Author Topic: If a specific chrome tab has focus, VC.EnableGroup*  (Read 5575 times)

0 Members and 1 Guest are viewing this topic.

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
If a specific chrome tab has focus, VC.EnableGroup*
« on: February 12, 2014, 06:37:47 AM »
Hello everyone! :)

I've been toying around with events lately, using this video:
as a reference.

I want VoxCommando to automagically detect that chrome is running and load a specific group when it has focus. This works great, but I have several groups I want to load based on what chrome window has focus.
For example: I have made a voice command to open www.netflix.com and using VC.EnableGroup* I enable my "Netflix" group which contains specific commands for that webpage.
The problem is if I use my keyboard+mouse to navigate to another webpage, the "Netflix" group is still enabled and the group for the newly opened webpage is obviously not activated..

Is there any way to change what group is activated based on the url/parts of the url, without issuing a voice command (example: if the chrome tab containing www.netflix.com/* is focused it enables the "Netflix" group)?
I had a look at logic blocks and the different options there, but I couldn't make it work.

I'm sure there is a way to do this! :) Any and all help greatly appreciated.

Regards,
Kristoffer

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #1 on: February 12, 2014, 11:14:26 AM »
Hi Kristoffer, and welcome to VC!

Unfortunately I'm not aware of any way to read the window title using the current version of VoxCommando.  It could probably be added as a new feature.

If you are comfortable with using EventGhost then it is possible to run a polling loop that checks the title of the current window and sends events to VoxCommando whenever the title changes.  This would trigger events any time you changed windows, but also if you browsed to a new site, since (with chrome anyway) the title of the window includes the title of the webpage you are viewing.  You could further extend the logic of the EventGhost script to only generate events for certain sites, or only for chrome etc.

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #2 on: February 13, 2014, 06:47:26 PM »
Thank you very much! And thanks for making such an awesome program/utility ^^,

If you somehow manage to implement that as a new feature I'd be ecstatic ;D

I've never used EventGhost, but I've heard tons of good things about it. I'll definitely look into your suggested method of solving this "problem".
That being said, I've looked into other ways of achieving what I want to do by using the Windows 8 Metro start screen and loads of autohotkey scripts...
I´ve customized the tiles to look like "speed dials" and by clicking the different tiles/icons I start a autohotkey script that launches chrome in kiosk mode (fullscreen), goes to the url specified in the script and loads the correct xpadder profile so I can use my xbox 360 controller to navigate.. BUT, I really need to enable a VC group too, so I can use my voice commands.

So my question is: Can a VC group be enabled through a script or maybe through EventGhost (could this be set up as a keyboard shortcut that I could trigger through the aforementioned script)? :)

Regards,
Kristoffer


EDIT: Seems to be possible through the Python plugin? Eep, does this mean I need to read up on Python and use that instead of autohotkey.. Hmm.

« Last Edit: February 13, 2014, 06:59:16 PM by krismyklebust »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #3 on: February 13, 2014, 09:31:05 PM »
You can trigger events or actions in VC through command line parameters or using udpsender.exe or from EventGhost (of course).

I assume that autohotkey can run a program with command line parameters.

http://voxcommando.com/mediawiki/index.php?title=API_Application_Programming_Interface

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #4 on: February 14, 2014, 04:52:00 AM »
I can't believe I didn't find that info! I'm so sorry, I must've overlooked it.
I should be able to run a program with command line parameters through autohotkey.

I can't wait to get home today and test this. Hopefully I can make it work using the information you've provided :D
I'll tinker with it a bit to see if I can find the right parameter to use.

Have a great weekend!

Regards,
Kristoffer

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #5 on: February 14, 2014, 05:44:09 AM »
If you search the info for the commandline parameter, take a look here:

http://voxcommando.com/mediawiki/index.php?title=Command_line

I hope this wiil help you  ;)
***********  get excited and make things  **********

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #6 on: February 14, 2014, 10:46:38 AM »
Thanks, Kalle :)

VoxCommando.exe -33000 "VC.EnableGroup*&&Netflix"   < Hopefully something like that would work! I'll know in a few hours ;)

On a sidenote... How do you like your smartwatch? My Omate TrueSmart should be arriving sometime next month I hope ^^,

Regards,
Kristoffer

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #7 on: February 14, 2014, 11:21:35 AM »
I think this will work.

Although the function is about the same I prefer to use the udpsender.exe instead of using VoxCommando.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #8 on: February 14, 2014, 12:41:11 PM »
I'm very happy with my smartwatch and I use it instead as my mobile  ;D

I think you have to wait until the beginning of march for your Omate  ;)
***********  get excited and make things  **********

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #9 on: February 16, 2014, 09:51:22 AM »
I finally got around to testing this and everything works as intended! Thank you both for the help :)

Kalle: The latest update says they'll begin shipping the EU version late February, so fingers crossed!
Do you use yours to control VoxCommando? If yes: is the mic alright or would there be problems recognizing commands if I am watching a TV show? =)

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #10 on: February 16, 2014, 09:56:43 AM »
The mic works very well, like the same as an Samsung Galaxy S2 mobile. I use it with VoxCommando the whole day  ;D
The 200 Euro was a good investment.

Here is a video with the smartwatch in action

http://www.youtube.com/watch?v=TMPstHDvnM8
« Last Edit: February 16, 2014, 09:59:05 AM by Kalle »
***********  get excited and make things  **********

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #11 on: February 16, 2014, 10:22:14 AM »
If yes: is the mic alright or would there be problems recognizing commands if I am watching a TV show? =)

I don't know about the final quality of the microphone on the Omate.  I am hoping to eventually find out...  >:(

As far as "while I am watching TV or listening to Music" scenario, yes any background sound will potentially be an issue, however with VoxWav you get events in VC that can be used to mute or soft-mute your audio output and this combined with the fact that you are holding the microphone only about 6-12 inches from your mouth means that you will probably get good results, as long as the microphone on the watch is of decent quality.

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #12 on: February 16, 2014, 11:08:17 AM »
Very true; that's a good point! :) You've thought about everything it seems! Is there anything VC can't do?  :biglaugh

I'm hoping there's a way to give commands through the TrueSmart without unlocking the watch and physically pressing the screen everytime.
Maybe there's a way to make one of the buttons on the side act as a mic on/off toggle..
I'm not sure how I feel about the "tilt to activate" feature - I mean, I love it "on paper", but wouldn´t it activate when you didn't want it to (say, if you move around on the couch for example..)?

krismyklebust

  • Jr. Member
  • **
  • Posts: 18
  • Karma: 4
    • View Profile
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #13 on: February 16, 2014, 11:16:02 AM »
Kalle. I watched your video and that actually looks really good! I'm even more excited now!  8)
I took another minute to think about things, and even if it activates when you move around it won't really matter since it'll only react to your voice commands anyway..
Out of curiosity, what keyboard are you using on your watch?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: If a specific chrome tab has focus, VC.EnableGroup*
« Reply #14 on: February 16, 2014, 11:51:01 AM »
I will probably allow you to set quite a precise angle for tilt if you want, so only if you are holding your wrist up "just so".  Also, VoxWav can give you a little buzz to remind you when the mic turns on and off.  As you say if you tilt by accident and don't speak not much is likely to happen, unless you tilt on and off many times quickly... I've had this happen and I needed to reboot my phone to get the mic working again...  :-[

If it is possible to use one of the buttons to speak then I will incorporate this options, but on my other android devices the buttons don't register when the screen is off (I allow you to remap the volume buttons, but they don't do anything on any of the 3 devices I have tested with, when the screen is off).  Also, these buttons might be used for more important things.  The omate only as 2 buttons and one at least would need to be for turning the screen on.

We will have to wait and see.  If I ever get my watch I will start testing these things out pretty much right away and I'll post about what I discover.