This property returns the reason why the SystemEvent is fired. This value can be :
-1 - means unknown
1 - means shutdown
2 - means loggingoff
<window on:system="onSystem();"/>
function onSystem()
{
var eventObj = shell.currentEvent;
if (eventObj)
{
if (eventObj.reason == 1)
{
shell.print("shutting down soon");
}
}
}