Max Vecheslavov Max Vecheslavov - 21 days ago 8
AppleScript Question

How to set Entitlements for finder?

I need to use an AppleScript in my app with enabled sandbox. Just using things like "tell Finder to bla-bla-bla". Very simple. I got that I need to make a record for finder in Entitlements something like this:

<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.apple.mail</key>
<array>
<string>com.apple.mail.compose</string>
</array>
</dict>


Is anybody know the correct entitlements record in XCode for Finder? I've try to use next option:

<key>com.apple.security.scripting-targets</key>
<dict>
<key>com.apple.finder</key>
<string>com.apple.finder</string>
</dict>


But it doesn't work.

Answer

The Finder does not support scripting targets so you need to use previous temporary exception.

<key>com.apple.security.temporary-exception.apple-events</key>
<array>
   <string>com.apple.finder</string>
</array>