Debugging prevents Folder Actions triggering

(Luciano Di Croce) #1

I am trying to trigger folder action when I drop a file on top of the downloads folder, but it is not working when the debugging function is ON. If I switch it off everything is OK.
My setting for the privacy are:

Any suggestions?

(Mark Alldritt) #2

Which version of macOS are you using?

If it is Mojave, then I suspect you are running into the new security limitations that can prevent one application sending AppleEvent commands to another.

Script Debugger’s remote debugging relies on being able to send an AppleEvent from the application running the script to Script Debugger.

(Luciano Di Croce) #3

Thanks Mark for replaying.
Yes. I am using Mojave. That is why I have included the screenshot above :wink:
How can I allow Script Debugger to perform as it was before (High Sierra)?
I already gave access to Script Debugger to “Full Disk Access” as well as to “System events” and “Finder”. Please see screenshot above.
What else should I do? In other words, who is “controlling” Folder Actions?

Thanks !

(Mark Alldritt) #4

The application that runs your scripts is /System/Library/CoreServices/FolderActionsDispatcher. This the application that somehow has to gain permission to send AppleEvents to Script Debugger in order for external debugging to work.

I’ll have to look into this further at my end.

In the meantime, you can simulate Folder Actions events within Script Debugger using the various Folder Actions items in the Folder Actions submenu of the Script > Execute and Script > Step commands:

Note that the commands in the Folder Actions sub menu are enabled when Script Debugger sees that your script contains the appropriate handlers.

(Luciano Di Croce) #5

I gave all possible permission to “FolderActionsDispatcher” but still the same problem. In the meantime I will use the " Script => Execute" simulation.
Thanks for the suggestion.
(By the way, I have the same problem on 2 different Macs, both running Mojave)


(Mark Alldritt) #6

I can’t be sure yet but I fear we may have lost the ability to debug folder actions scripts executing in the Folder Actions Dispatcher with Mojave. This may be one more piece of collateral damage from Mojave’s security hardening.