Dt is not executing AppleScript

I cannot run simple Applescripts from within DT 3. I can run them from the Script Editor.

There appears to be a deeper issue with my mac in relation to DT.

Other apps are controlling DT; but DT doesn’t appear in the Automation section of the Preference.

Do you guys have an experience with this kind of issue?

07_09_23 at 09.41.55PM

„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 find some clues from Popclip’s forum ( How To: Make macOS ask for permission again - How-Tos & Guides - PopClip Forum); and was able to solve the issue.

Running the following was able to force DT to request permission for System events:

do shell script "osascript -e 'tell application \"System Events\" to keystroke \"a\"'"

:+1:
Here’s what I see on Ventura:

I guess DT must have asked me for permission at one point in the past, but I don’t remember.

1 Like

I am still using Monterey.
Unfortunately, the above trick worked on some scripts but not others.

I am not able to run the Annotation Pane, for example.

I will upgrade to Ventura and see if it fixes the issue.

Unfortunately, the above trick worked on some scripts but not others.

Like which scripts?

I am not able to run the Annotation Pane, for example.

? Can you clarify what you’re referring to here?

The “Toggle the Sidebar” script is working now (after the above trick). But, the annotation pane Annotation Pane (Annotation with Links, Notes, Tags v3)) is not getting executed.

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:

Is anything reported in DEVONthink’s Window > Log?

nothing there

I have been using it for years. It suddenly stopped working for me.

And have you updated the operating system recently?

PS: That’s a third-party script, not something we wrote.

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?

No such change has been made I am aware of.

1 Like

That is right. I just tried Lorem Generator, which is script bundle, worked fine.

And you’re running the script from DEVONthink’s script menu?

If so, hold the Option key and choose Help > Report bug to start a support ticket. Perhaps there’s something useful in the logs.

1 Like

i just did

That is it!
Turns out the cause of the problem is that DT had no control over Finder.

do shell script "osascript -e 'tell application \"Finder\" to keystroke \"a\"'

This one forced DT to ask for permission.

The script is running fine now.

Thanks

Glad to hear it :slight_smile:

1 Like