„I cannot“ is not a comprehensive problem description. If you see an error message: what does it say? If not, how do you know that you can’t run AS code „from within DT“? How do you try to run it?
I run it from the Script menu. I , for example, tried to execute the “toggle sidebar” script which I believe is shopped with Dt. Nothing happens. And, nothing is recorded in the log.
But, if I open the script in Script Editor and run it there, it does toggle the sidebar.
It looks like that DT has not permission to System Events.
I have been using it for years. It suddenly stopped working for me. The strange part is it still works when I run it from the Script Editor; BUT not when I run it from DT’s menu (nor from Keyboard Maestro).
The Automation section of my preference looks like this:
Yes, I updated my OS to Monterey; and now (today) to Ventura.
I am now suspecting that the issue is contingent with the fact that Annotation Pane comes in the form of “Script bundle”.
KM is behaving differently on how I call for the script:
if I pasted the script directly into it, it fails to run it; but If it tell to run the file (Annotation Pane.scptd), it executes it correctly.
Is there any change that DT is no more supporting Script bundles?