Scripts can also be added to a layer using the Embedded Script File option in the General panel of the Layer Settings dialog box. When this option is enabled, a File dialog box opens where you can locate a script to execute when the layer is encountered.