(function () {
    try {
        app.beginUndoGroup("Reveal Current Comp");

        // Deselect all the item
        if (app.project.selection != null)
            for (i = app.project.selection.length - 1; i >= 0; i--)
                app.project.selection[i].selected = false;

        // Select items which are selected
        var proj = app.project;
        var comp = proj.activeItem;
        if (comp) {
            comp.selected = true;
        }

    } catch (err) {
        alert(err);
    } finally {
        app.endUndoGroup();
    }
})();