potionfactory/LetsMove

App not being deleted on macOS Big Sur and later

Opened this issue · 3 comments

The framework copies the app to /Applications but doesn't remove it from ~/Downloads.

When an app is running with the attribute "com.apple.quarantine" (meaning downloaded from the Internet) it's running in so called translocation mode and the current workaround for this - trashing the app via AppleScript using Finder. Well, it no longer works on macOS Big Sur and Monterey obviously:

Trash AppleScript error: {
NSAppleScriptErrorAppName = Finder;
NSAppleScriptErrorBriefMessage = "Not authorized to send Apple events to Finder.";
NSAppleScriptErrorMessage = "Not authorized to send Apple events to Finder.";
NSAppleScriptErrorNumber = "-1743";
NSAppleScriptErrorRange = "NSRange: {267, 70}";

There's a solution but as a result a user must allow to control Finder (which is not cool unfortunately 😢 ):

Screen Shot 2021-09-27 at 9 55 41 PM

You will need to:

  • add "com.apple.security.automation.apple-events" attribute to your code signing entitlements
  • add NSAppleEventsUsageDescription to the app plist file, e.g.
<key>NSAppleEventsUsageDescription</key>
<string>Please allow the app to move itself via Apple Script.</string>

We're using LetsMove in CommandPost, and I've had a few users report this as well.

Any thoughts on this @andypotion or @potionfactory ? As more people move across to Big Sur, we're seeing more reports of issues from users.

Just updated the initial post, see above.