Skip to content

Commit b254f8a

Browse files
committed
modified readme
1 parent 75b3522 commit b254f8a

File tree

1 file changed

+8
-17
lines changed

1 file changed

+8
-17
lines changed

README.md

Lines changed: 8 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This is an Atom package/plugin that lets VoiceCode http://voicecode.io control Atom http://atom.io
44

5-
This integration is needed because many VoiceCode voice commands are more sophisticated than simply pressing keys or clicking the mouse. For example, a command that *selects the next curly brace*, or a command that *extends the current selection(s) forward until the next comma*, etc.
5+
This integration is needed because many VoiceCode voice commands are more sophisticated than simply pressing keys or clicking the mouse. For example, a command that *selects the next curly brace*, or a command that *extends the current selection(s) forward until the next comma*, etc. It also enables synchronous bidirectional communication between VoiceCode and Atom.
66

77
## Setup
88

@@ -41,28 +41,19 @@ Then, in your VoiceCode user commands, you can call this Atom command as follows
4141
And for a more concrete example, it may look like this in VoiceCode:
4242

4343
```coffeescript
44-
"commandName":
45-
kind: "action"
46-
description: "does something cool, and has an override for Atom IDE"
44+
atom.commands
45+
"my-command":
46+
spoken: "next word"
4747
grammarType: "numberCapture"
48-
action: (input) ->
49-
switch @currentApplication()
50-
when "Sublime Text"
51-
@exec "subl --command 'select_next_word'"
52-
when "Atom"
53-
@runAtomCommand "myCoolCommand",
54-
distance: input
55-
value: "something"
56-
else
57-
# do some default action
48+
action: (input = 1) ->
49+
@runAtomCommand 'selectNextWord', {distance: input}
5850
```
5951

6052
### Triggering existing Atom commands
61-
62-
In VoiceCode simply do:
53+
The Atom editor has a ton of built-in commands, and each Atom package adds even more. Any of these commands can be triggered directly from VoiceCode. In VoiceCode simply do:
6354

6455
```coffeescript
65-
@runAtomCommand "trigger", "tree-view:add-file"
56+
@runAtomCommand "trigger", {command: "tree-view:add-file"}
6657
```
6758

6859
## Contributing

0 commit comments

Comments
 (0)