t4ngo / dragonfly

ARCHIVED! - Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS) and Windows Speech Recognition (WSR)
GNU Lesser General Public License v3.0
364 stars 82 forks source link

Multiple specs for a single rule? #6

Closed namanyayg closed 10 years ago

namanyayg commented 10 years ago

Using this for a home automation project, will be helpful if there are various ways I can execute the same thing. Thoughts?

synkarius commented 10 years ago

Use parentheses and the pipe symbol in the spec. Check out the examples under the "hardware management" section here: https://github.com/synkarius/dragonfly-sorcery/blob/master/_general.py

As you can see, with the spec "(switch | change) monitors" the command is triggered by either "switch monitors" or "change monitors".

You can also use the Playback action if you're looking to use one command to trigger another one or several others in succession: http://dragonfly.readthedocs.org/en/latest/actions.html#playback-action

namanyayg commented 10 years ago

Awesome @synkarius, thank you very very much! The example especially was very helpful :)

synkarius commented 10 years ago

Glad I could help. :)

t4ngo commented 10 years ago

Thanks for the help, Synkarius!