{"id":592,"date":"2011-07-26T20:36:43","date_gmt":"2011-07-27T00:36:43","guid":{"rendered":"http:\/\/www.victorandreoni.com\/blog\/?p=592"},"modified":"2013-08-25T01:52:20","modified_gmt":"2013-08-25T05:52:20","slug":"cleanshutdown-fighting-lions-dictatorship","status":"publish","type":"post","link":"https:\/\/www.victorandreoni.com\/blog\/2011\/07\/26\/cleanshutdown-fighting-lions-dictatorship\/","title":{"rendered":"CleanShutDown"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"border= 0 px aligncenter\" style=\"background-color: transparent; border: 0px;\" alt=\"CleanShutDown\" src=\"http:\/\/www.victorandreoni.com\/blog\/wp-content\/uploads\/2011\/07\/power.png\" width=\"128\" height=\"128\" \/><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">After using MacOsX Lion for a while, one of the most annoying &#8220;features&#8221; for me is the saved state, where apps are automatically launched after resetting or shutting down your Mac.<br \/>\nThe idea is pretty good, but the annoyance comes when you have to uncheck a little box each and every time you turn off or restart your Mac in order to disable it.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">After digging around the defaults configuration, I found the following string:<\/span><\/p>\n<blockquote><p>TALLogoutSavesState = 1<\/p><\/blockquote>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">According to my common sense, changing that 1 for a 0 should disable the function. It actually worked, but the configuration was lost after each reboot, meaning that you had to go into terminal and write the &#8220;0&#8221; into that string every time you wanted to restart or shut down your computer. At the end, I was easier to uncheck the little box.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">However, I built a small applescript that will write the 0 for you, and then turn off your Mac, and all this with just one simple click on the icon of the app.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">As it came very handy to me, I decided to share it online. So please feel free to download it, report any bugs or comments on this post, and share with your friends!<\/span><\/p>\n<p style=\"text-align: justify;\"><strong>GUI Scripting Version (Somewhat Cleaner)<\/strong><\/p>\n<p style=\"text-align: justify;\"><strong><span style=\"color: #000000;\">Note: To fix the &#8220;Access to assistive devices disabled.&#8221; error follow these simple steps:<\/span><\/strong><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">Go into System Preferences -&gt; Universal Access -&gt; Check box at bottom for \u201cEnable Access for assistive Devices\u201d.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"color: #000000;\">After that, manually log out or reboot your system for changes to take effect. (Thanks Mccleodx for pointing this out!)<\/span><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.victorandreoni.com\/count\/CleanShutDown\/csd.php\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-603 aligncenter\" style=\"background-color: transparent; border: 0px;\" title=\"downloadIcon\" alt=\"Download\" src=\"http:\/\/www.victorandreoni.com\/blog\/wp-content\/uploads\/2011\/07\/downloadIcon.png\" width=\"128\" height=\"128\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">Download 2.0.2<\/span><\/p>\n<blockquote><p>Change log<\/p>\n<p>2.0.2<\/p>\n<p>&#8211; Increased delay time to fix &#8220;Can&#8217;t get windSow 1&#8230;&#8221; error.<\/p>\n<p>2.0.1<\/p>\n<p>&#8211; Script now compatible with any language.<\/p>\n<p>2.0<\/p>\n<p>&#8211; Changed working method. Instead of editing the defaults of &#8220;<em>TALLogoutSavesState&#8221;, <\/em>the application now interacts with Finder as if it was the user clicking the checkbox and then clicking the Shut Down option.<\/p>\n<p>1.0<\/p>\n<p>&#8211; Initial Release<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p style=\"text-align: left;\"><strong><span style=\"color: #000000;\">Shell Script Version (Use if GUI version conflicts with your system) <\/span><\/strong><\/p>\n<p style=\"text-align: center;\"><a href=\"http:\/\/www.victorandreoni.com\/count\/CleanShutDownS\/csd.php\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-603 aligncenter\" style=\"background-color: transparent; border: 0px;\" title=\"downloadIcon\" alt=\"Download\" src=\"http:\/\/www.victorandreoni.com\/blog\/wp-content\/uploads\/2011\/07\/downloadIcon.png\" width=\"128\" height=\"128\" \/><\/a><\/p>\n<p style=\"text-align: center;\"><span style=\"color: #000000;\">Download Shell Version<\/span><\/p>\n<blockquote><p>Change log<\/p>\n<p>S<\/p>\n<p>&#8211; Uses Shell Scripting instead of GUI Scripting<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>After using MacOsX Lion for a while, one of the most annoying &#8220;features&#8221; for me is the saved state, where apps are automatically launched after resetting or shutting down your Mac. The idea is pretty good, but the annoyance comes when you have to uncheck a little box each and every time you turn off [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[49,52,87,93,155,159,187,189,219,231,239,247,255,285],"class_list":["post-592","post","type-post","status-publish","format-standard","hentry","category-mac-os-x","tag-apps","tag-auto","tag-deactivated","tag-down","tag-lion","tag-mac","tag-open","tag-os","tag-resume","tag-saved","tag-shut","tag-state","tag-terminal","tag-x"],"_links":{"self":[{"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/posts\/592","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/comments?post=592"}],"version-history":[{"count":2,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions"}],"predecessor-version":[{"id":703,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/posts\/592\/revisions\/703"}],"wp:attachment":[{"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/media?parent=592"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/categories?post=592"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.victorandreoni.com\/blog\/wp-json\/wp\/v2\/tags?post=592"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}