Listen for wildcard support

Here you are welcome to post Push2Run feature requests
Post Reply
Mherber2
Posts: 10
Joined: Thu Nov 26, 2020 2:20 am

Listen for wildcard support

Post by Mherber2 »

The ability to have wildcards in the listen for field would improve usability and decrease rules required resulting in a cleaner user experience.

For example, the card for 'Close window' might contain the following under Listen for:
close active window
close that
close that window
close the active screen
close the active window
close the current screen
close the current window
close the window

This could be truncated with wildcard support to Listen for:
close * window
close * screen
close that *

or possible a single rule such as
* close *


Another recent use case i have come across is with opening applications such as task manager and others. Multiple rules are needed to encompass natural human language however they can often be replaced with a single command. For example,

open task manager
open the task manager
task manager

could be shortened to

*task manager*
RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

just to let you know, I've coded this in and it will be available in the next release of Push2Run - likely in January (but maybe sooner).

Here's what the help will say (to give you an idea of how it will work):
Listen for

This is where the phrases Push2Run will listen for and react to are setup.

The program automatically sorts these for you, removes duplicate entries, and unnecessary white spaces. All words are also automatically converted to lower case and spell checked with words underlined in red when they are unknown to the spell checker.

With the 'Listen for' phases, you can have Push2Run listen for exact phrases.

For example, exact phrases such as:
open the calculator
start the calculator


Additionally, asterisks ('*') may be used as a wild card to have Push2Run listen for expressions containing a broader range of phrases. Here are some examples:

1. * calculator
to trigger on any phrase ending with the word 'calculator', such as: 'open the calculator' or 'run the calculator'

2. calculator *
to trigger on any phrase starting with the word 'calculator', such as: 'calculator open'

3. * calculator *
to trigger on any phrase containing the word 'calculator', such as: 'open the calculator now'


Finally, in more advanced use, a dollar sign ('$') may be added at the end of the phrase to listen for and Push2Run will pass the end part of your command to the open and parameters fields below.

For example, if you can use:
search for $

and in this example, say 'OK Google tell my computer to search for bunny rabbits" and have "bunny rabbits" passed into the Open and Parameters fields for processing (see below for more information).
Mherber2
Posts: 10
Joined: Thu Nov 26, 2020 2:20 am

Re: Listen for wildcard support

Post by Mherber2 »

Hey Rob!

I've been working on the linux side of this problem and i've found that using regex expressions has been the easiest way to address this issue. Using regex expressions for pattern recognition in the 'listen for' field would cut down on the number of rules to complete a task.

If users need assistance generating regex expressions to match patterns, there are tools available such as this one: https://github.com/ecrmnn/minta

What are your thoughts of implementing regex expressions in the listen for field???
RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

I think regex will be beyond most Push2Run users. In fact, to be honest, most times it's beyond me. What I've coded should do the trick in most cases.
RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

Wild card support is now available in Push2Run v 3.4.2 (released today).
starkery
Posts: 3
Joined: Thu Jun 03, 2021 5:41 pm

Re: Listen for wildcard support

Post by starkery »

I tried using something like * volume at $ so that it can understand both set volume at $ and put volume at $, but no success, it seems your * doesn't like working with $
RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

starkrey

Thanks for bringing that to my attention - I'm working on/testing a fix now.

Would you like to try out a beta with this issue, hopefully, resolved?
starkery
Posts: 3
Joined: Thu Jun 03, 2021 5:41 pm

Re: Listen for wildcard support

Post by starkery »

Yeah sure
RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

RobLatour
Site Admin
Posts: 1023
Joined: Mon Feb 19, 2018 11:43 am

Re: Listen for wildcard support

Post by RobLatour »

I successfully finished the testing for this morning and put the change to support a 'Listen for' phrase of '* something $' in with a new version of the program (v3.6.1) now publicly release.

Also added in to this release were a few additional edits when saving a Push2Run card; these were not in the beta linked to above.

Finally, as the program is now in general release, the beta has been removed from the file servers.
Post Reply