Upgrading to Mojave

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.

1 Like

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…

GUI Scripting

Wow, what a mess.

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…

FYI, if you codesign the app with a developer ID, you only need to OK things the first time.

The thing that costs $99?

One of the things you get when you pay $~99 (per year), yes.

You do realize that it’s not a viable solution for Script Debugger non-pro users :slight_smile:

If there is a way to push Apple to create a reasonable mechanism then that’s something we should organize right now. Otherwise SD is a dead product for 99% of it current users.

I’m not sure what you mean. The situation with GUI scripting applies regardless of the editor.

this does not apply to Script Editor

In Script Editor, I don’t have to even go to System Preferences > Security & Privacy > Accessibility once.

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.)

1 Like

Sorry that I was not clear. I run my scripts as apps because they are easier to call/run from Spotlight. Thank you for the clarifications.