To restart Ubuntu 12.04 you now have to open a terminal (ctrl+alt+t), type "sudo shutdown -r 0" , followed by your password. I have been trying to write a script in Autokey to do this automatically, but can't manage to bring up the terminal window: keyboard.send_keys("++t") doesn't seem to work, so presumably an instruction to open gnome-terminal is needed.
If anyone has a quick answer to this I would be very grateful - otherwise I'll try to learn some Debian coding.....
Thanks in advance, Kaspin"

To shutdown your system using an AutoKey script here's what you need to do.

Select a folder in AutoKey ("New Script" will only be available when a folder is selected)

Go to File -> Create -> New Script

Enter the following for the script:

system.exec_command("gksu shutdown -r 0", False)

NOTE: Looking at the AutoKey sample scripts it looks like you use system.exec_command() to execute shell commands which would be the equilivlent to calling the standard python function subprocess.call("Some shell command", shell=True) (if you're familiar with python).

Click the "Set" button to the right of "Hotkey". Click "Press to Set", press your desired shortcut key, and then click any desired modifiers for that key ("Control", "Alt", "Shift", "Super"), and then "OK".