I’ll be using this thread to document the issues I have with AS and the ecosystem while running Mojave, which I just installed a few days ago.
Running my scripts
All the scripts that were installed on the machine and that I’ve used so far run without problem.
The first time I run them, authorization dialogs popup every time the script sends commands to a given application with a message like [theScript] wants to control [theApplication] and if it does then it can manipulate data, etc., that includes System Events.
Sometimes the scripts ask to add the script to the applications that are allowed to control the computer in System Preferences > Security & Privacy > Accessibility, allowing for that by clicking on the button that opens the preferences seems to be enough to proceed. Since the preferences are password protected on my machine, I usually unlock the preference, validate the addition, and go back to the script.
Writing / modifying scripts
I’ve had no time to try that for now so I’ll write about this later.
For some reason, some scripts require more than allowing them to interact with their target application by hitting the button on the alert that’s displayed when you run them and you need to actually go to the Accessibility settings and add it there. Weird.
Recording in Script Debugger requires validating Script Debugger access to all the currently running applications. Script Editor does not require that, of course. So you end up having to click two dozen times on the OK button before you can start to record anything. Interesting…
The first time I ran this new script mojave asked me to OK all sorts of interactions and complained that the script did not have access to the Accessibility features. So I add it there and it works.
But every time I edit the script and run it, I need to go to System Preferences > Security & Privacy > Accessibility and uncheck/check the box associated to the script to give it access again to the accessibility features. Every single edit saved…
I think I may have misunderstood you — I thought you meant running it as an app after editing it. If you’re just running it within Script Debugger, you should be asked to add Script Debugger in Accessibility if you haven’t already, not the script — and you should never have to do it again. There’s no reason for the script to even appear under Accessibility — that only happens when you run it as an app. And at that point, it behaves (almost) the same regardless of its origin.
(I say almost because the default bundle Script Editor gives to applets begins with com.apple., which might carry some magical powers.)
But I also regularly see situations where the whole system gets confused, and somehow clears itself after a bit of time and a relaunch or two.
Just to be clear, as far as I’m aware, the differences in terms of security-related behavior between Script Editor and Script Debugger are:
Script Debugger needs permission the first time you address an application, whereas Script Editor has baked-in permission to address any app.
Script Editor cannot load any third-party frameworks. This means you cannot edit or run scripts that use libraries like Myriad Tables Lib, BridgePlus, or SQLite Lib, or which try to load third-party frameworks directly.
Their behavior in terms of Accessibility should be identical.
(And I’m obviously biased, but I think the app permission issue is a small price to pay when the trade-off was access to third-party frameworks.)