Script writers can use a special command that allows scripts to be attached to menu commands. For security purposes, InDesign includes a preference that determines whether attached scripts are allowed. If you trust the source of an InDesign document, you can select Enable Attached Scripts so that scripts run whenever you choose the commands to which they’re attached.