def create_script_job(self):
        script_job_no = pm.scriptJob(
            e=["SelectionChanged",
                'if pm.ls(sl=1) and pm.ls(sl=1)[0].name() == "%s":\n'
                '    pm.displayPref(displayAffected=False)\n'
                'else:\n'
                '    pm.displayPref(displayAffected=True)' % self.light.name()
            ]
        )
        self.store_data('%s' % script_job_no)
creates the script job that disables the affected highlight
dataset/ETHPy150Open eoyilmaz/anima/anima/env/mayaEnv/auxiliary.py/BarnDoorSimulator.create_script_job