I couldn't get the exact error message, even if I set the output type to “window”.
So I tried putting the AppleScript into the shell script block, so it now looks like this:
/usr/local/bin/growlnotify \
--appIcon "BBEdit" \
--identifier "$RANDOM" \
--message "Setting current file to 'Unix Shell Script'" \
--title "Keyboard Maestro"
/usr/bin/osascript <<EOT
tell application "BBEdit"
activate
set source language of text document 1 to "Unix Shell Script"
end tell
EOT
I ran it again, and this time, it worked. No errors.
I tested this script in both Script Debugger and KM, and it worked fine with no errors.
So it must be a Mojave Beta issue.
Make sure you are using the latest ver of KM, and have reset the KM Accessibility permissions. Although this should be fixed, you may have to do one or more of the following until it works.
Yeah, it works if I set it up as an AppleScript in BBEdit's menu too, but I get an error from Keyboard Maestro if I try to select that Script’s menu item.
This is so weird I'm assuming it has to be a Mojave-beta issue.
The error is shown complete in the Engine.log file (Help ➤ Open Logs Folder).
Mojave Public Beta 5 / Developer Beta 6 has very broken AppleScript permissions as far as Keyboard Maestro is concerned. It toggles permission back and forth between Keyboard Maestro and Keyboard Maestro Engine. For some/most people, this results in it prompting for permissions twice for every time you try to do anything. For others it seems it just does not prompt at all and disallows it. It seems you fall in to this camp.
This is a regression in Public Beta 5 / Developer Beta 6 and I have heard no word from Apple as far as them working to resolve this. Hopefully they are.
Actually, that makes sense, given what I've seen elsewhere. I have AppleScript “apps” which now fail to run, and AppleScript scripts which say they have no permission to do something, but never prompt me to give that permission.
I certainly hope this will be fixed before Mojave hits 1.0. Otherwise, Mojave is going to be a huge step-back for automation on the Mac.