Creating your first command

Learn how custom commands are organized in packages and how to create your first custom command in Javascript.

Introduction

Custom commands in SoundFlow is an extremely powerful way to create personalized, intelligent workflows that can make your life easier.
Custom commands are written in a programming language called Javascript, which is arguably one of the most (if not the most) popular programming languages in the world. It is not only a powerful and easy to learn language, it also has an enourmous amount of online learning tutorials - some of which we have gathered here.
To create your own custom commands, you'll need to learn Javascript. But you can also install packages containing custom commands from other users - without ever writing a single line of code.
In the future we will also be introducing custom command macros, which will be a code-free equivalent of custom commands that won't require you to learn Javascript.

Custom command packages

Custom commands in SoundFlow are organized in custom command packages. In the package view you can see the custom command packages right under the "All Commands" item:
When you first create your SoundFlow user account, we automatically create a "Default Package" for you to make it easier to get started. This is because you can't create a command without putting it in a package - so it's easier if there's already a default package when you start.

Creating a new command

To create a new command, first select the command package folder you want to create it in. If you haven't selected a folder, the new command might end up in the Default Package, or if you don't have a default package and haven't selected a folder, it might not be possible to create a new command at all.
You create a new command by pressing Cmd+N or choosing Command -> New Custom Command... from the Command menu:
This brings up the New Custom Command popup window:
Here you can choose a name for your new command. Choose something that will help you remember what it is doing. You can later rename your command by double clicking it.
I'll name this one "My first command" and hit OK:
And voila, my command now shows up in the Default package that I selected:

Writing the code

In the lower right portion of the SoundFlow window, is SoundFlow's code editor:
Let's write a super simple beginner script to make sure that our new command is working properly.
Type the following into the editor:
log('This is a my first SoundFlow command');
It should look like this:
To test our command, press the "Run Command" button just above the script:
Yay! Now we see a notification with our message: