Post

Replies

Boosts

Views

Activity

Reply to XProtect makes app hang when running an AppleScript
Some more information: My AppleScripts usually are very simple because the app does the heavy lifting. Think getting the accounts for Mail or the account type. I have 2 places in the app where I use AppleScript. In the Setup the users determines which email she wants to archive from Mail. And then the user can archive the emails to a database. The Setup uses the AppleScripts in a thread. Archiving is threaded, too. But the AppleScripts are run on the main thread and before threading starts. The scripts run fine on the main thread. These are the same scripts which are used in the Setup!!! I've moved the first AppleScript to osascript and now the second script hangs which is still using NSAppleScript. The plan for today is to move more AppleScripts to osascript.
Topic: Privacy & Security SubTopic: General Tags:
3d
Reply to Customize message for NSWorkSpace.requestAuthorization?
Of course, you are correct. I'm using Xojo and the code is a bit different. I have a class to remove files. It gets the authorisation and the uses Filemanager with authorisation to delete some files: Private Property theFileManager As NSFileManagerMBS Public Sub Constructor(hasAppName as String, hasAuthorization as NSWorkspaceAuthorizationMBS, doRegistration as Boolean) AppName = hasAppName myAuthorisation = hasAuthorization theFileManager = NSFileManagerMBS.fileManagerWithAuthorization(myAuthorisation) DeleteApp if doRegistration then removeRegistration End Sub And Delete App: AppFolder = SpecialFolder.Applications if AppFolder <> nil and AppFolder.Exists then AppFolder = AppFolder.Child(AppCommon.getInstallationAppName) if AppFolder = Nil or not AppFolder.Exists or not AppFolder.Directory then Return dim theError as NSErrorMBS dim theResult as Boolean = theFileManager.removeItem(AppFolder, theError)
Topic: App & System Services SubTopic: General Tags:
Jun ’23