To track events:

Choose Window > Event Log History.

Choose the type of event information to be logged from the pop-up menu.
As you run your script, the events performed by the script are displayed in the Event Log History. Events are displayed in a hierarchy. Click the disclosure triangle next to an event to see the items within it.
Click Show Script, or double-click an event to open the script in a separate window.