# Can't get app added to Privacy/Automation

**URL:** <https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914>\
**Category:** macOS\
**Created:** [March 7, 2022, 5:52am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914 "2022-03-07T05:52:52Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 7, 2022, 5:52am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/1 "2022-03-07T05:52:52Z")

</div>

The user has 2 computers. One one computer my app works fine. On the second one the app is declining Automation approval on it’s own. I let the user reset Automation with a Terminal command. Then I made him a test app with the following code from the MBS plugin examples:

```auto
dim target as NSAppleEventDescriptorMBS = NSAppleEventDescriptorMBS.descriptorWithBundleIdentifier("com.apple.Mail")

// we ask for all apple events
dim e as integer = NSAppleScriptMBS.DeterminePermissionToAutomateTarget(target, " ****", "****", true)
if e = 0 or e = -1 then
  MessageBox "everything okay"
else
  MsgBox str(e)+": "+errorToString(e)
  Return
end if

```

The full app has the usual plist, codesign, notarisation. I made sure that the test app has the same.

Neither the full app or the test app show up in the Automation pane at all for the user.

Instead of getting the usual “blabla wants to control Mail” the result is an error -1743: Not permitted. Any ideas what else I could try to get Automation working?

---

<div class="post-metadata">

**Author:** ![Arnaud\_N](https://forum.xojo.com/user_avatar/forum.xojo.com/arnaud_n/32/21824_2.png) [@Arnaud\_N](https://forum.xojo.com/u/Arnaud_N)\
**Post date:** [March 7, 2022, 7:52am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/2 "2022-03-07T07:52:34Z")

</div>

Has your user tried to restart its computer?  
I’ve seen such restarts reset weird things regarding the “new Apple privacy system”.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 7, 2022, 9:24am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/3 "2022-03-07T09:24:42Z")

</div>

Thanks, I think I forgot to ask the user to restart. §$%& security.

---

<div class="post-metadata">

**Author:** ![Arnaud\_N](https://forum.xojo.com/user_avatar/forum.xojo.com/arnaud_n/32/21824_2.png) [@Arnaud\_N](https://forum.xojo.com/u/Arnaud_N)\
**Post date:** [March 7, 2022, 5:05pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/4 "2022-03-07T17:05:33Z")

</div>

You’re welcome; though it can be very well another issue.

> [@Beatrix\_Willius](#):
>
> §$%& security.

Can we still name it that way? That’s rather a “lock out”…

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 9, 2022, 10:27am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/5 "2022-03-09T10:27:08Z")

</div>

I now had reports from 3 users that they can’t get access to Automation.

They all restarted their computer. No change.

I made another test version with a different bundle id. But I didn’t get anyone to test that - too complicted.

I suggested for 2 of them to contact AppleSupport. I hope that they get back to me. I’m going to do a Zoom session with the third tomorrow.

One user has 2 computers - one with Crapolina and one with Monterey. My app makes problems on Crapolina. Monterey is fine.

The only change I did compared to the last version of my app is that the app is now universal.

Out of ideas…

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [March 9, 2022, 10:40pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/6 "2022-03-09T22:40:13Z")

</div>

Send me the test app and some basic reproduction steps.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 10, 2022, 1:03pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/7 "2022-03-10T13:03:15Z")

</div>

@Sam_Rowlands : thanks.

One user solved the problem on his own. I just did a screensharing with another user and everything works fine on his computer. I don’t know what he did before.

Confused…

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 13, 2022, 1:17pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/8 "2022-03-13T13:17:53Z")

</div>

Do a “tccutil reset AppleEvents” in Terminal.  
Start version 6.1.3 of my app. Get mailboxes from Mail: everything is okay.  
Do a “tccutil reset AppleEvents” in Terminal.  
Start version 6.2 of my app. Get mailboxes from Mail: no dice.

If there is no NSAppleEventsUsageDescription then I get the same result -1643 “don’t wanna” instead of asking for the permissions.

I don’t have a plist file but do everything in an IDE script with localisation:

`command = "/bin/echo 'NSAppleEventsUsageDescription = ""Mail Archiver uses AppleScript to communicate with Mail and Outlook, Filemaker.""; '>>" + appPath + "/Contents/Resources/en.lproj/InfoPlist.strings" Call DoShellCommand(command)`

The strings are in the plist where they should be.

Why does the app get the NSAppleEventsUsageDescription in debug and after building but not in the notarized dmg?

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 13, 2022, 1:36pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/9 "2022-03-13T13:36:59Z")

</div>

I can reproduce the behaviour. If I pack and notarise a test app with AppWrapper then AppleScript doesn’t work. App is available at [http://mothsoftware.com/downloads/max-test.zip](http://mothsoftware.com/downloads/max-test.zip) .

@Sam_Rowlands : bug in AppWrapper?

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [March 13, 2022, 1:58pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/10 "2022-03-13T13:58:29Z")

</div>

> [@Beatrix\_Willius](#):
>
> @Sam_Rowlands : bug in AppWrapper?

There are indeed no privacy usage strings in your test applications plist. I don’t think it is a bug with App Wrapper as App Wrapper also uses them (you can check the App Wrapper plist file if you like).

I am a bit confused, you say you don’t use a plist, but then say they’re in the plist. AFAICT that command line snippet processes the localized version of the strings and NOT the actual plist.

I think I need more information for this.

Start by building a version of your application, ensuring the keys are in the plist file. Then drag that application to App Wrapper to process it, once the wrapped version of the application and check the plist. Notarize it and then check the plist of the Notarized version.

Otherwise please send me a copy of the unwrapped application and your App Wrapper data file, so I can attempt to reproduce it here.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 13, 2022, 2:23pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/11 "2022-03-13T14:23:48Z")

</div>

I add the information for the plist with an IDE script. Because of the localisation the information is not in the plist but in the locale files:

 ![Screenshot 2022-03-13 at 15.23.08](https://forum.xojo.com/uploads/default/original/2X/b/b37a53d6dfac96752bce4aac2f3de773599d9754.jpeg)

> [@Sam\_Rowlands](#):
>
> Otherwise please send me a copy of the unwrapped application and your App Wrapper data file, so I can attempt to reproduce it here.

I’ve sent you the test project and the AppWrapper file.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 13, 2022, 2:34pm UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/12 "2022-03-13T14:34:40Z")

</div>

Probably this is my stupidity - as usual. In version 6.1.3 I’m using an entitlements file:

 ![Screenshot 2022-03-13 at 15.29.37](https://forum.xojo.com/uploads/default/original/2X/1/1e10320c924e658e861badebcb239d4806c3fed0.jpeg)

AppWrapper doesn’t have an extra entitlement for AppleScript. Instead it has the following section:

 ![Screenshot 2022-03-13 at 15.33.34](https://forum.xojo.com/uploads/default/original/2X/0/00b5e35d6caa1fa51a2fdaf08b7fc593517a7738.png)

My guess is that the switch does the entitlement.

I hate Apple security.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [March 14, 2022, 12:19am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/13 "2022-03-14T00:19:28Z")

</div>

> [@Beatrix\_Willius](#):
>
> My guess is that the switch does the entitlement.

Correct. The field “Usage string” is also where you add the “Default” usage string.

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [March 14, 2022, 1:52am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/14 "2022-03-14T01:52:30Z")

</div>

@Beatrix_Willius

- I can confirm that your project built with 2021r1, works in debug while unsigned and not including the Usage strings in the actual plist file. I did have to replace the MBS AppleScript code with OAK AppleScript code.
- Wrapped with App Wrapper, using your App Wrapper file, it continues to work.
- Unselected the option in the “Automation” section of “Security & Privacy” and it gives me the error message “Not Authorized”.
- Using your commandline function to reset TCCs does indeed make the application return “Not Authorized”.
- Firing up “Find Any File” asks me to Authorize it.
- Attempting to use AppleScript from App Wrapper also asks me to authorize it.
- Success - Enabling AppleScript in the Capabilities pane of App Wrapper and setting a Usage string “Mail Archiver X can then access mail in Apple Mail and others”. Then asked me to authorize when I re-opened your demo application.

So it appears that Apple have different rules for unsigned applications and signed applications, which quit frankly is not surprising as they’re about as well organized as I am (which is not).

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 14, 2022, 6:04am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/15 "2022-03-14T06:04:48Z")

</div>

I got the test app working fine with AppleScript. The final app does NOT work. Does AppWrapper propagate the AppleScript entitlement to helper apps?

---

<div class="post-metadata">

**Author:** ![Sam\_Rowlands](https://forum.xojo.com/user_avatar/forum.xojo.com/sam_rowlands/32/265_2.png) [@Sam\_Rowlands](https://forum.xojo.com/u/Sam_Rowlands)\
**Post date:** [March 14, 2022, 6:21am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/16 "2022-03-14T06:21:34Z")

</div>

I see, so the AppleScript is being called from a Helper. Is the helper being launched by the main application or another application, say the commandline or a something?

Is the final application for the Mac App Store or website deployment?

Click on the “Options” button next to “Code signing” in the sidebar and check the "Nested executable entitlements popup menu.

- Default - Will pick what App Wrapper understands to be the best method. With the App Sandbox, it uses “Inheritance Plus” otherwise “main”.
- Inheritance Plus - Uses Inherited Entitlements, as well as including certain entitlements for Hardened Runtime.
- Inheritance - Uses Inherited Entitlements for nested executables.
- Main Entitlements - Uses the exact same entitlements for the main application and nested components.
- None - I don’t recall why this was added.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 14, 2022, 7:19am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/17 "2022-03-14T07:19:07Z")

</div>

What is the difference between Inheritance, Inheritance Plus and Main Entitlements? Isn’t Main and Inheritance the same?

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 14, 2022, 8:17am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/18 "2022-03-14T08:17:53Z")

</div>

Both Main and Inheritance plus don’t work. What now?

The “Helper” app is an app that is installed by a self written installer. No commandline. The final app is for website deployment.

 ![Screenshot 2022-03-14 at 09.20.46](https://forum.xojo.com/uploads/default/original/2X/e/e100844cdd5bb09150fc7b732cce27b244ee417b.jpeg)

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 14, 2022, 9:37am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/19 "2022-03-14T09:37:42Z")

</div>

AppWrapper is overwriting the existing entitlements. In the old version of my app I used an entitlement plist file and did the codesign in code. The current version should use only AppWrapper for codesigning, creating the dmg and notarisation. But I forgot to take out the codesign.

I just did a test where I built the app and then only used “Pack & Notarise” instead of “Wrap, Pack & Notarise” and I finally got the automation correct. Now the path of the second app in the dmg is wrong but at least I’m making progress.

---

<div class="post-metadata">

**Author:** ![Beatrix\_Willius](https://forum.xojo.com/user_avatar/forum.xojo.com/beatrix_willius/32/282_2.png) [@Beatrix\_Willius](https://forum.xojo.com/u/Beatrix_Willius)\
**Post date:** [March 14, 2022, 10:10am UTC](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914/20 "2022-03-14T10:10:55Z")

</div>

How can I script AppWrapper not to do a codesign? Using “Wrap, Pack & Notarise” fubars the Automation security even with "“Nested executable entitlements” set to none.

If necessary I can do my app in 2 steps for a while.

[Next page](https://forum.xojo.com/t/cant-get-app-added-to-privacy-automation/68914.md?page=2)
