How can we assign simple script to hotkeys or buttons in a simple way ...

How can we assign simple script to hotkeys or buttons in a simple way ...