{"id":1232,"date":"2009-05-19T13:57:52","date_gmt":"2009-05-19T17:57:52","guid":{"rendered":"http:\/\/www.schollnick.net\/wordpress\/?p=1232"},"modified":"2009-05-19T14:34:52","modified_gmt":"2009-05-19T18:34:52","slug":"worried-about-free-disk-space","status":"publish","type":"post","link":"http:\/\/www.schollnick.net\/wordpress\/2009\/05\/worried-about-free-disk-space\/","title":{"rendered":"Worried about Free Disk Space?"},"content":{"rendered":"<p>Over at <a href=\"http:\/\/www.macintouch.com\/readerreports\/helpplease\/index.html#d19may2009\">Macintouch<\/a>, a user has contributed an Applescript that will display when the amount of freespace on the drive, drops below a preset limit.<\/p>\n<pre>tell application 'Finder'<\/pre>\n<pre>-- sets up variables<\/pre>\n<pre>set theSize to capacity of startup disk -- total size of disk<\/pre>\n<pre>set freeSpace to free space of startup disk -- amount of free space<\/pre>\n<pre>-- changes size in bytes to size in MB and rounds it off<\/pre>\n<pre>set theSize to round (theSize \/ (1028 * 1028))<\/pre>\n<pre>set freeSpace to round (freeSpace \/ (1028 * 1028))<\/pre>\n<pre>-- calculates the percentage of free disk space<\/pre>\n<pre>set percentFree to round (freeSpace \/ theSize) * 100<\/pre>\n<pre>if percentFree  10 then<\/pre>\n<pre>display dialog 'You have less then 10% free disk space. Your computer will explode momentarily, so please run away now.' buttons {'Run!'} with icon stop<\/pre>\n<pre>else if percentFree  20 then<\/pre>\n<pre>display dialog 'You have less then 20% free disk space. Your computer is preparing to explode, so please prepare to run away.' buttons {'Hmmm\u00e2\u20ac\u00a6'} with icon caution<\/pre>\n<pre>else if percentFree  30 then<\/pre>\n<pre>display dialog 'You have less then 30% free disk space. Please tell someone about this as your computer is due to explode sometime in the near future.' buttons {'OK'} with icon note<\/pre>\n<pre>(*<\/pre>\n<pre>else<\/pre>\n<pre>display dialog 'You have ' &amp; percentFree &amp; '% free space left. Keep working until I tell you to stop.'<\/pre>\n<pre>*)<\/pre>\n<pre>end if<\/pre>\n<pre>end tell<\/pre>\n<p>[&#8230;] Save the script somewhere, then save it again as an application rather than a script (making sure to uncheck all the options in the Save As dialog). All you have to do is make the application a startup item (in the Login Items tab of the Accounts section of the System Preferences). Every time the machine is started the app will run and warn you if you&#8217;ve reached an appropriate level of &#8216;explosiveness.&#8217; If you&#8217;ve not reached any of the percentages, the user won&#8217;t see anything at all.&#8221;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Over at Macintouch, a user has contributed an Applescript that will display when the amount of freespace on the drive, drops below a preset limit. tell application &#8216;Finder&#8217; &#8212; sets up variables set theSize to capacity of startup disk &#8212; total size of disk set freeSpace to free space of startup disk &#8212; amount of <a class=\"read-more\" href=\"http:\/\/www.schollnick.net\/wordpress\/2009\/05\/worried-about-free-disk-space\/\">[&hellip;]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[12,5,25],"tags":[83],"_links":{"self":[{"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/posts\/1232"}],"collection":[{"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/comments?post=1232"}],"version-history":[{"count":0,"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/posts\/1232\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/media?parent=1232"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/categories?post=1232"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.schollnick.net\/wordpress\/wp-json\/wp\/v2\/tags?post=1232"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}<!-- WP Super Cache is installed but broken. The constant WPCACHEHOME must be set in the file wp-config.php and point at the WP Super Cache plugin directory. -->