How to write Applescript to press Escape key?

applescript, macos

Solution

simple,

tell application "System Events"
     key code 53
end tell

Problem

I am writing an apple-script. In which I need to write code which means to hit escape button. I'm not getting how to do it. Can any one help?

Original source