Menu

Create a command: Advanced

In addition to the basic command types, users with coding knowledge can create more complex custom commands to perform a wide variety of tasks.

Important: To avoid misrecognition and conflicts with existing commands, it is important that you choose a name that is at least two words. Avoid words such as "that," "one," "two," etc.

AppleScript

The AppleScript command type is the most flexible, offering users familiar with the scripting language fine control over a wide variety of tasks.

When you select AppleScript from the Type dropdown, you will see an AppleScript script editing environment. Enter your script in the Source field: you can compile and run it right in the Commands Manager.

Many built-in Dragon commands are AppleScript commands. For example, below is the built-in command to close the current file:

AppleScript command

Shell Script

You can use Shell Script commands to perform a variety of tasks. The script should begin with a "shebang" line (e.g. #!banshee).

When you select Shell Script in the Type dropdown, you will see a Shell Script editing environment. Enter the script you want to execute here.

For example, you could create a command that launches Safari when you say Show Safari by entering open -a safari.

Running a shell script does not open the Terminal, and there is no means of viewing output; a shell script to be run from within Dragon should generally be created and tested elsewhere.

Automator Workflow

If you have an Automator Workflow file, you can create a command to execute it. For example, if you made a workflow to resize photos, you can create a command to trigger that workflow by saying Resize photos.

When you select Automator Workflow in the Type dropdown, you will see the Workflow location field. Drag the workflow file to the field, or enter the path to its location.