Hi Peter;
I suggest you read the SPA9000 administration guide (available on this community - documentation section), there is a nice section on AA scripting. You should be able to create one, then post it here, people can help on the review.
Regards
Alberto