{"id":22551,"date":"2018-08-23T16:14:19","date_gmt":"2018-08-23T20:14:19","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=22551"},"modified":"2020-07-03T16:52:08","modified_gmt":"2020-07-03T20:52:08","slug":"apple-events-usage-description","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2018\/08\/23\/apple-events-usage-description\/","title":{"rendered":"Apple Events Usage Description"},"content":{"rendered":"<p><a href=\"https:\/\/indiestack.com\/2018\/08\/apple-events-usage-description\/\">Daniel Jalkut<\/a>:<\/p>\n<blockquote cite=\"https:\/\/indiestack.com\/2018\/08\/apple-events-usage-description\/\">\n<p>Until Paul mentioned his own problems, I glossed over these failures because I was satisfied that my production built versions, linked against the 10.13 SDK, were &ldquo;working fine.&rdquo; But Paul&rsquo;s report got me thinking: was it possible there is some unspoken contract here, whereby linking against the 10.14 SDK opens up my app to additional privacy related requirements?<\/p>\n<p>I tapped into Xcode&rsquo;s Info.plist editor for FastScripts, added a new field, and typed &ldquo;Privacy&rdquo; on a hunch, because I&rsquo;ve come to realize that Apple prefixes the plain-English description for most, if not all, of their &ldquo;usage explanation&rdquo; Info.plist fields with this word[&#8230;]<\/p>\n<p>Aha, that first one looks promising. You can right-click on an Info.plist string in Xcode to &ldquo;Show Raw Keys\/Values&rdquo;, and doing so reveals that the Info.plist key in question is &ldquo;NSAppleEventsUsageDescription&rdquo;. After adding the key to my app, I built and run again, and running the same script as above now yields the expected authorization pane[&#8230;]<\/p>\n<\/blockquote>\n\n<p>I believe the <a href=\"https:\/\/developer.apple.com\/wwdc18\/702\">WWDC session<\/a> said that the other usage descriptions are required if you build with the macOS 10.14 SDK. <code>NSAppleEventsUsageDescription<\/code> was not added until <a href=\"https:\/\/forums.developer.apple.com\/thread\/105225\">Beta 7<\/a>, though. It&rsquo;s kind of odd that this key just has a single string value, since an app might want to send events to any number of different apps, for different reasons. Everything needs to go in that one string.<\/p>\n\n<p>And it&rsquo;s too bad there&rsquo;s no corresponding usage description or prompt for Full Disk Access. Your app just gets a permissions error, and you have to explain to the user how to enable access in System Preferences.<\/p>\n\n<p>Previously: <a href=\"https:\/\/mjtsai.com\/blog\/2018\/06\/28\/apple-event-sandboxing-in-macos-mojave-lacks-essential-apis\/\">Apple Event Sandboxing in macOS Mojave Lacks Essential APIs<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>Daniel Jalkut: Until Paul mentioned his own problems, I glossed over these failures because I was satisfied that my production built versions, linked against the 10.13 SDK, were &ldquo;working fine.&rdquo; But Paul&rsquo;s report got me thinking: was it possible there is some unspoken contract here, whereby linking against the 10.14 SDK opens up my app [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2018-08-23T20:14:21Z","apple_news_api_id":"a62e4427-3dc9-45c0-bbce-48a7e005b30a","apple_news_api_modified_at":"2020-07-03T20:52:11Z","apple_news_api_revision":"AAAAAAAAAAAAAAAAAAAAAA==","apple_news_api_share_url":"https:\/\/apple.news\/Api5EJz3JRcC7zkin4AWzCg","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[159,30,1609,355,71,1960,226],"class_list":["post-22551","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-applescript","tag-mac","tag-macos-10-14","tag-privacy","tag-programming","tag-transparency-consent-and-control-tcc","tag-xcode"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22551","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=22551"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22551\/revisions"}],"predecessor-version":[{"id":22552,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/22551\/revisions\/22552"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=22551"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=22551"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=22551"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}