Writing a scripted alert action to process results