AppleScript permissions problem on Mojave

AppleScript continues to make problems for me and some customers. Before executing an AppleScript I ask with NSAppleScriptMBS.DeterminePermissionToAutomateTarget if the app has permissions to execute the script. I have had this myself over the weekend: the app didn’t show the dialog to ask for the permissions but jumped right to the dialog that is shown when the permissions were declined. AND in the permissions section of System Preferences/Privacy the app was allowed to do AppleScripts.

For myself I simply removed all copies of my app and everything went back to working. But I can’t tell my users that. Am I doing something wrong?

[code]'get permissions for new app
dim target as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier(BundleID)

// we ask for all apple events
PermissionsForApp = NSAppleScriptMBS.DeterminePermissionToAutomateTarget(target, “", "”, true)
PermissionsDictionary.Value(BundleID) = PermissionsForApp

if PermissionsForApp = 0 or PermissionsForApp = -1 then
'everything okay
Return True
else
dim Message as string = ReplaceAll(kNoPermission, “<>”, app.ApplicationNameMBS)
dim theResult as Integer = globals.theErrorLog.dialogErrorCancelWithDefaultButton(Message, kHelpMe)
if theResult = 1 then
ShowURL(“https://www.mothsoftware.com/blog_page.php?permalink=mail-archiver-and-mojave”)
end if
Return False
end if[/code]

just a guess here… but perhaps you permission request if broader than Mojave will allow? Try limiting to only those permissions you really need if possible???

No, that’s not the root cause. I don’t have single AppleEvents. And the code works most of the time but not always.

For my apps gave this problem, but I solved the problem putting them in the area of applications that controlled the entire computer in preferences, have you tried it ?

ah, a tip, if you put a new version or even install the same app even if it’s in the Privacy administrator folder, you have to delete it from there and put it back !

@Paulo Vargas: can you explain in more detail what you mean? I don’t understand “area of applications that controlled the entire computer in preferences,” and “Privacy administrator folder”.

What I noticed is that you have to completely uninstall the app and then everything works fine after reinstalling. I’m not sure if the user is still meant to have backups that aren’t TimeMachine on Mojave.

[quote=415770:@Beatrix Willius]@Paulo Vargas: can you explain in more detail what you mean? I don’t understand “area of applications that controlled the entire computer in preferences,” and “Privacy administrator folder”.

What I noticed is that you have to completely uninstall the app and then everything works fine after reinstalling. I’m not sure if the user is still meant to have backups that aren’t TimeMachine on Mojave.[/quote]

Beatrix There is a folder in System Preferences / security and privacy tab of Mojave that “frees” the application to run the computer, you have to drag the applications that need these permissions, my applications I put there and they worked, my system is in Portuguese- BR so I do not know the name of this folder on the English system but it is present there