The secret is to use keystrokes, as it seems you can't record mouse clicks.
If you use the Windows key instead of the Start button, you can see the 'shortcut' letters for the commands.
Standby: Windows u s
Turn Off: Windows u u
Restart: Windows u r
'Famous for answering my own questions'