How to turn on/off visibility of the layers in a linked InDesign file

This script demonstrates how to turn on/off vivibility of the layers in a linked InDesign file. Download, unzip, open the sample InDesign document and run the script against it.

Before

After