1. A method of executing a scripting language, the method comprising the steps of: receiving a plurality of instructions that conform to said scripting language, wherein said scripting language defines instructions that correspond to operations that a user specifies through a graphical user interface; detecting at least one context that is associated with a set of one or more instructions from said plurality of instructions, corresponds to at least one user input mode of said graphical user interface, and specifies at least one state for said at least one user input mode; and in response to detecting, executing said one or more instructions based on said at least one state for said user input mode.