This App is No Longer Maintained. Visit the Replacement at StrokesPlus.net

StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General Discussion
 General Discussion
 What if several applications are matched?
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

Cerberus

Netherlands
86 Posts

Posted - 05/05/2012 :  09:41:38  Show Profile  Visit Cerberus's Homepage
What happens if a window/control matches several "applications"? I am thinking of one general application for e.g. Firefox, and one that matches only Firefox windows with certain titles.

Rob

USA
2615 Posts

Posted - 05/05/2012 :  19:03:21  Show Profile  Visit Rob's Homepage
It will stop processing once it reaches an application match, then try to match the drawn gesture to an action (though if no match exists for that application, the only additional check would look for the gesture/action match in Global (wouldn't proceed to the next application match). The order of processing is based on the order of creation in StrokesPlus.xml (it processes top-down). In theory, I was never able to think of a reason why there would be a use case for multiple matches. A gener match can further determine the course of action within the Lua. For example, I have a Login action for Chrome, in that action, it gets the title of the window, then executes different things based on the title..just as an example alternative.

There are various potential approaches to what you're trying to do; give me an example or two of what you'd like to have happen.
Go to Top of Page

Cerberus

Netherlands
86 Posts

Posted - 05/05/2012 :  19:12:47  Show Profile  Visit Cerberus's Homepage
Ah OK, thanks for clearing that up. I might want to perform different actions based on the page I was on in Forefox, but, as you say, that can easily be done with Lua or AHK, so multiple match checking is unnecessary (and probably slower). I mainly asked out of general curiosity; I already differentiate actions based on FF page titles with AHK anyway.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/05/2012 :  19:16:18  Show Profile  Visit Rob's Homepage
But remember you can also make an application definition using a regular expression pattern as well. Kind of a pain for a bunch of title checks, but perfectly possible.
Go to Top of Page

Cerberus

Netherlands
86 Posts

Posted - 05/05/2012 :  20:01:50  Show Profile  Visit Cerberus's Homepage
Yeah I have noticed. It is pretty cool, so you could make one application "all Firefox windows except Google", and one "all Firefox windows with Google". How much would you reckon this slows things down?

Edited by - Cerberus on 05/05/2012 20:06:54
Go to Top of Page

Rob

USA
2615 Posts

Posted - 05/05/2012 :  20:13:19  Show Profile  Visit Rob's Homepage
Not much, the regex is very efficient (it uses the BOOST libraries).
Go to Top of Page

Hax

128 Posts

Posted - 06/07/2012 :  05:43:19  Show Profile
I have three window classes:
Winamp v1.x
Winamp PE
Winamp Gen

I'd like to know how to make a single regular expression pattern for them.
Go to Top of Page

Rob

USA
2615 Posts

Posted - 06/07/2012 :  08:04:38  Show Profile  Visit Rob's Homepage
The regex to use would be:

Winamp (v1\.x|PE|Gen)

However, your question uncovered a HUGE bug with the App pattern matching..basically, the expression entered was being stored in a const variable, so the first time a valid expression was matched, it became a permanent fixed value until S+ was restarted. I was still really new to C++ at the time and I'm sure I copy/pasted some code I found. I don't use the patterns so a simple test of the code would work fine because I wasn't trying others!

Update to version 1.9.4.

I can see you trying regex patterns that SHOULD work, but nothing was going your way at all, am I right? =)

I actually made 3 windows apps which use the class names you mentioned and tested the match on all, so you shouldn't have a problem with actual Winamp.
Go to Top of Page

Hax

128 Posts

Posted - 06/07/2012 :  08:30:33  Show Profile
Yeah, I tried several patterns without success. The new version has fixed that thing. It's OK now. Thanks!
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000