Thanks Rick, the syntax did the trick indeed.
And I can only agree the best way to work is taking it step by step, so I focussed on getting the alert working first. Once that was done I tried to make the change, but as I failed I constructed the rest of the script to have some progress.
It's an approach that works for me so I don't get depressed too fast :-)