Assistance with building macros

I've been needing to get macros set up for certain occasions. I've been through the Wiki page and most of it makes sense but what would be the best way to have an announcement be played? The Wiki has an example of one but doesn't explain how they did it.

For instance, I need a node to disconnect from a node, connect to another, and then play a local announcement.

Thanks
K9NMT

Brent,
The skinny way to think of this is...
Everything you want to do has to have a command you can run by dtmf code.

A macro is just those commands in order of execution.

So if you want a macro that includes a localplay of a sound file, there must be a command for that. If you don't have one, you need to make one.

123=localplay, /etc/asteisk/messages/mymessage.wav

Use in the macro

1=*31999 *123#

Hope that helps get you through the rough spot.
Be aware you do need to be care when selecting a command number so even the first few digits don't conflict with a shorter command.
Asterisk is a first match processor.
So if you use 123
There can not be a 12= or 1234= etc.
Keep your commands in numeric order if you can in the file to avoid such things.

That makes sense now, I was just overthinking it. I basically just need to create a command for each audio file I need and enable it with a DTMF code.

Appreciate it very much!!

Following on from Mike's comment I use 11-99 for macros. This gives me plenty of capacity. I tend to use 11-30 for connections. I use the 80-89 range for general system stuff such as play the morse ident or say what the current connections are. To use DTMF you would send *511 to run macro 11.

So under functions I might have;

M11=cmd,/usr/local/sbin/connect_freestar.sh
M41=cmd,/usr/sbin/asterisk -rx 'rpt localplay 47587 /var/lib/asterisk/sounds/hal_cantdo'

Then under the macro stanza;

[macro]

;;;;; Macro commands ;;;;;
11 = *M11#
41 = *M41#

I usually use scripts (.sh) behind the macro so that I do a bunch of additional checks before connecting to another node/hub/net.