If your scripts fail to run, this is most likely an issue with the macOS Security and Privacy Preferences. You should be able to remedy this problem by doing the following -
- Bring up your Mac System Preferences Window
- Select the Security & Privacy Preference
- Select the Privacy Tab
- Scroll down until you see Automation
- Enable the Finder Checkbox under Adobe InDesign 2020.app (or the latest version of InDesign you see listed under the Automation area).