Export AppleScript as Application - not working properly

Whenever I export an AppleScript to an application, errors appear upon opening, and these errors repeat every time I reopen it. I managed to get the application to launch without errors (3 applications with different names) out of 30+ attempts. The code is same.

Where am I going wrong?

Errors:
Would like to access files in your Documents…
Apple script is not allowed to send keystrokes…

Device: Mac mini M4 (MacOS 15.4)

Can you post screenshots of the error dialogs?

Errors

For the first prompt, do you mean that you have already clicked Allow numerous times before, but the dialog keeps showing up?

For the keystrokes error, I’m not exactly sure. Normally, there should be a prompt to adjust some accessibility settings (possibly one of those that are already checked in your screenshots from the previous post). I’m sure others will chime in.

Yes. Always after new run my app.

By “new run of your app”, did you recompile or re-save the app in your Editor. Each time you do, the app gets a new security key generated, therefore the OS thinks it’s a new/different app and goes thru the security dialogs again. The pitfalls of Apple’s extreme security of the latest OSes.