Can't "OK" or dismiss app access permission dialog

I’m running Mac OS 11.6.5 (my iMac is too old to run Monterey) and I get this dialog

“Script Debugger” wants access to control “Adobe inDesign”. Clicking “OK” does nothing and I can’t even get rid of the dialog. Where in System Preferences can I give such permission, and to what?

Look in Security and privacy. As soon as you open it, there may be an option to give SD control of ID. If not, click on the privacy tab, select “Automation” on the left, and SD on the right. You can’t add apps here, but if it’s not checked, you can check it.

Thanks for your quick response! I did what you said, and this included screenshot shows that. But I’m still getting that damn notice! What else should I do, please?!

I just noticed that my screenshot shows inDesign as UNchecked, but it IS CHECKED! See here!

Here’s another screenshot which shows inDesign checked for Script Debugger access.

You need to quit and relaunch Script Debugger for the change in permissions to take effect.

I did that and got the same dialog again

Same dialog popped up after attempting to run the script again.
When I went back to System Preferences>Privacy>Automation, this is what I see.

InDesign is still checked for control permission.

First thing to try is a restart. Switch access off first, restart, then turn it on. If that doesn’t work, you’re left with the nuclear option: use tccutil to delete the relevant setting, restart, and try again. A search on tccutil should bring up full instructions, and they’re probably around here somewhere.

The might help: macos - How can I remove Applications from Security & Privacy? - Ask Different