Scripts are not executable after move to new mac

I changed computers recently. I reinstalled DEVONthink 3.9 on the new machine and copied the AppleScripts from my previous ~/Library/Application Scripts/com.devon-technologies.think3/Menu/ to the same location in the new Mac. They show up at the bottom of the scripts menu as usual,

but are grayed out and unselected/unrunnable. Does anyone know why this might be, and how I can make the scripts executable again?

I checked in a terminal and ls -l shows the files have the execute bit set.

What about the rest of the permissions? On my machine, the execute bit not set for one of the scripts we share:

-rw-r--r--@  1 rmschne  staff  4946 18 Nov 08:34 Open Clean Workspace.scpt
1 Like

Scripts are only disabled while another script (including the ones of smart rules & reminders) is executed.

1 Like

The scripts don’t need execute permission, I think – they’re just text files “run” by an app (DT, Script Editor etc). If you’d want to run them directly from the shell, ie using a she-bang or so, they’d need to be executable.

1 Like

Thanks – that’s actually what I think too, but because I couldn’t figure out why they were grayed out in DT, I mentioned the state of the execute bit in case it was relevant after all, somehow …

If you mean permissions like read permissions, then yes. (I didn’t mention it because it’s so basic and I’m kind of an experienced user.)

I did also check extended attributes. Some of them have then, and some don’t have any, and because they’re all grayed out, it doesn’t seem likely that it makes a difference to DEVONthink. For example, in the case of “Open Clean Workspace”,

But others have none at all, yet all the scripts (with extended attributes and without, with POSIX execute bit or without) grayed out in DEVONthink’s menu …

1 Like

Thank you for that tip! So it turns out that DEVONthink was using 100% of a CPU core and was reading from the disk drive (as reported by iStat Menus), so something probably was running (perhaps a script gone rogue). I restarted DEVONthink and the activity has stopped, but unfortunately, the items in the script menu are still grayed out.

(I checked the Window ▹ Activity and Window ▹ Log windows before restarting, but they showed nothing. Is there any way to get DEVONthink to report what script or action is being executed when it’s busy like that?)

That’s not possible but you could temporarily disable all smart rule actions (via the contextual menu of the sidebar), assuming that it’s caused by a smart rule.

1 Like

I’m sorry to waste your time with what must be a trivial question, but I cannot seem to find a context menu item that would disable all rules. Do you mean to do it by first selecting all rules and then right-clicking, to get the same contextual menu that one would get by right-clicking a single rule? Or is there a menu that applies globally to all rules at once?

Update: that was it. A smart rule had an action to run a script, which in turn ran an external program, but the external program had gotten moved due to other things I was doing on my mac. I didn’t know the smart rule and its action were failing – for some reason the error check in my applescript script didn’t trigger and produce the dialog it should have, even after restarting DT. (Restarting would cause the smart rule to trigger again because its conditions were still satisfied, because it never executed its actions.) However, I restarted DT again a couple of more times while trying to debug this issue, and finally one time, I got the error dialog, which told me the external program that failed to be executed, which immediately made me realize which of my smart rules was the culprit. Quitting DEVONthink, fixing the program installation, and then restarting DEVONthink made the rule run normally, and all subsequent smart rules too.

Odd thing: I had to restart DEVONthink one more time after this was fixed, before the menu items in the script menu were un-grayed.

1 Like

Do you mean to do it by first selecting all rules and then right-clicking, to get the same contextual menu that one would get by right-clicking a single rule?

Yes. You can enable/disable selected smart rules as long as they’re in the same state, e.g., enabling disabled rules or disabling enabled rules. If you have a mix of them, the command isn’t available.

1 Like