BeforeViewSwitch Event
Using events with Automation
ViewSwitch Event