UXP Scripts
InDesign v18.0 onwards supports UXP scripts.
Scripts are the quickest and easiest way to automate tasks. Read the introduction to Scripts & Plugins to understand if scripts are the right fit for your use case before proceeding.
This section will help you write your first script, and explain important concepts required to understand how scripts work.