This extension illustrates how to cancel a command from script.