{"id":207,"date":"2009-01-13T01:38:29","date_gmt":"2009-01-13T06:38:29","guid":{"rendered":"http:\/\/vgable.com\/blog\/2009\/01\/13\/running-in-the-background\/"},"modified":"2009-01-13T01:41:42","modified_gmt":"2009-01-13T06:41:42","slug":"running-in-the-background","status":"publish","type":"post","link":"https:\/\/vgable.com\/blog\/2009\/01\/13\/running-in-the-background\/","title":{"rendered":"Running in the Background"},"content":{"rendered":"<p>If you want your bundled application to run in the background &#8212; not show up in the dock &#8212; here&#8217;s what you do.  Add<\/p>\n<p><code>&lt;key&gt;<a href=\"http:\/\/developer.apple.com\/documentation\/MacOSX\/Conceptual\/BPRuntimeConfig\/Articles\/PListKeys.html#\/\/apple_ref\/doc\/uid\/20001431-108256\">LSUIElement<\/a>&lt;\/key&gt;<br \/>\n&lt;string&gt;1&lt;\/string&gt;<br \/>\n<\/code><br \/>\n(exclusive) or<br \/>\n<code><br \/>\n&lt;key&gt;LSBackgroundOnly&lt;\/key&gt;<br \/>\n&lt;string&gt;1&lt;\/string&gt;<br \/>\n<\/code><\/p>\n<p>To your <code>info.plist<\/code> file.  Use only one or the other.<\/p>\n<p><code><a href=\"http:\/\/developer.apple.com\/documentation\/MacOSX\/Conceptual\/BPRuntimeConfig\/Articles\/PListKeys.html#\/\/apple_ref\/doc\/uid\/20001431-108256\"> LSUIElement<\/a><\/code> will let you put up windows and dialogs.  They&#8217;ll appear in the context of whatever application is frontmost at the time.  If your process might ever need to put up an alert, this is what you should use.<\/p>\n<p>If you choose <code>LSBackgroundOnly<\/code>, then windows and dialogs won&#8217;t work.  Note that if you are writing a daemon, <a href=\"http:\/\/developer.apple.com\/technotes\/tn2005\/tn2083.html#SECLIVINGDANGEROUSLY\">there are frameworks that you can not use<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you want your bundled application to run in the background &#8212; not show up in the dock &#8212; here&#8217;s what you do. Add &lt;key&gt;LSUIElement&lt;\/key&gt; &lt;string&gt;1&lt;\/string&gt; (exclusive) or &lt;key&gt;LSBackgroundOnly&lt;\/key&gt; &lt;string&gt;1&lt;\/string&gt; To your info.plist file. Use only one or the other. LSUIElement will let you put up windows and dialogs. They&#8217;ll appear in the context of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18,3,4],"tags":[300],"class_list":["post-207","post","type-post","status-publish","format-standard","hentry","category-bug-bite","category-macosx","category-programming","tag-daemon"],"_links":{"self":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/207","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/comments?post=207"}],"version-history":[{"count":0,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/posts\/207\/revisions"}],"wp:attachment":[{"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/media?parent=207"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/categories?post=207"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vgable.com\/blog\/wp-json\/wp\/v2\/tags?post=207"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}