We have the highly useful lodash library defined as `_` globally.
In order of being evaluated:
For every new file (.coffee or .js) you create, we create a package named `user:filename`. From inside that file, you can reference the current file's auto-generated package as the variable simply named `Package`.
unboundmusic/dc2158ff83dc85dbf9babc60beca7a11
The above will create a command with id `user:my-file:my-test-command` which can be triggered by saying @does it [email protected]
The `Package` variable is a convenient shortcut, but you don't have to use it if you want to just create your own package with its own name.
Let's say you have an application Notepad.app, for which you want to implement the `delete:lines` @[email protected] command. First you need to find the bundle id for Notepad.app. Either run the following command at a shell prompt:
```
$ osascript -e 'id of app "Notepad"'
``
OR
There are two slightly different ways you could implement the `delete:lines` command:
First you would create a scope that encapsulates when this group of commands should be "active"
unboundmusic/0d9741da6cbd5a63b1c3ffdc17c00e3d
Next use this file's Package to create or implement commands, supplying the scope name for which the implementations apply:
unboundmusic/b7e346f3df107573ea8a69619cce2e95
First, create a package, give it a good name, and set the applications and/or conditions for when this package should be "active".
unboundmusic/b22afb987dafe8851e94d1aaa6cf2254
A scope is automatically generated for this package since it has an `application` parameter (the package `name` will be used as the `name` of the auto generated Scope). Next, use this package to implement some commands that were already created somewhere else. These implementations will automatically be active only when the package is active:
unboundmusic/e5246d304ce1d87b2c115861b1cd3690
pro tip
Use `core:insert-command-id` @[email protected] command followed by the command you want to get the id for:
@sherlock [email protected] => will type `delete:lines`
@sherlock [email protected] => will type `core:insert-command-id`
@sherlock [email protected] => will type `common:enter`
This is especially useful when adding to `Settings.vocabulary.sequences`