Keyboard Maestro 10 Features in a Video

The purpose of a Subroutine, compared to a normal macro, is two-fold.

First feature:

First, it lets you define the parameters that the macro needs in order to do whatever it does. You can actually think of subroutine parameters like the values you specify in typical actions. For example, consider this built-in action:

image

It requires an X position, and a Y position. Those are parameters.

Suppose you wrote a macro with a Subroutine trigger, like this:

image

When you call it as a Subroutine in another macro, you get this:

image

Very similar to an action with parameters.

Yes, you could pass parameters to macros using other methods, but Subroutines make it obvious what they need in order to operate.

Second feature:

You can return a result. Consider this built-in action:

image

It reads a file, and returns the result to your variable.

You could do the same with your own Subroutine (not that you need your own version of this - it's just an example):

image

And when you call the subroutine, it would look like this:

image

Theat's a start.