{"id":583,"date":"2019-04-05T10:14:19","date_gmt":"2019-04-05T14:14:19","guid":{"rendered":"http:\/\/www.amixa.com\/blog\/?p=583"},"modified":"2019-12-04T11:20:59","modified_gmt":"2019-12-04T16:20:59","slug":"automatically-empty-google-drive-trash","status":"publish","type":"post","link":"https:\/\/www.amixa.com\/blog\/2019\/04\/05\/automatically-empty-google-drive-trash\/","title":{"rendered":"Automatically Empty Google Drive Trash"},"content":{"rendered":"<p>Want to empty your Google Drive Trash automatically?\u00a0 I finally have the solution for you.<\/p>\n<ol>\n<li><span style=\"color: #ff6600;\"><strong><em>Make sure you use GOOGLE CHROME web browser for best results.<\/em><\/strong><\/span><\/li>\n<li><span style=\"color: #ff6600;\"><strong><em>Open Chrome and go to www.google.com<\/em><\/strong><\/span><\/li>\n<li><span style=\"color: #ff6600;\"><strong><em>Make sure you are signed into your Google account.\u00a0 If not, sign in.<\/em><\/strong><\/span><\/li>\n<li>You should OBVIOUSLY have Google Drive account up and running since that&#8217;s why you&#8217;re here, right?<\/li>\n<li>Go here <a href=\"https:\/\/script.google.com\/home\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/script.google.com\/home<\/a><\/li>\n<li>Click NEW PROJECT.<\/li>\n<li>Clear out the default code that appears in the next window.<\/li>\n<li>Paste in this code (exactly)\n<pre>function createTimeDrivenTriggers() {\r\n\u00a0 ScriptApp.newTrigger('emptyThrash')\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .timeBased()\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .everyHours(1)\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 .create();\r\n}\r\nfunction emptyThrash()\r\n{\r\nDrive.Files.emptyTrash();\r\n}\r\n<\/pre>\n<\/li>\n<li>Click the Save Icon<\/li>\n<li>Enter a name such as &#8220;Automatically Empty Google Drive Trash&#8221;<\/li>\n<li>Click the &#8220;Resources -&gt; Advanced Google Services&#8221; menu within the Code editor<\/li>\n<li>\u00a0Scroll down and turn &#8220;Drive API&#8221; to &#8220;ON&#8221;<\/li>\n<li>You should see a message &#8220;These services must also be enabled in the Google Cloud Platform API Dashboard&#8221;.\u00a0 <strong>Click that link.<\/strong><\/li>\n<li><strong><span style=\"color: #993300;\">NOTE:<\/span><\/strong>\u00a0 If you DO NOT see the message above, <a href=\"https:\/\/console.cloud.google.com\/apis\/dashboard\" target=\"_blank\" rel=\"noopener noreferrer\">click this direct link<\/a><\/li>\n<li>Click &#8220;ENABLE APIS AND SERVICES&#8221;<\/li>\n<li>Locate &#8220;Google Drive API&#8221; and click it.<\/li>\n<li>Click Enable<\/li>\n<li>Go back to your browser window with the &#8220;Advanced Google Services&#8221; window still open.<\/li>\n<li>Click OK<\/li>\n<li>Click the &#8220;Run&#8221; icon within the project editor<\/li>\n<li>You should see &#8220;Authorization Required&#8221;.\u00a0 Click Review Permissions<\/li>\n<li>Choose your google account (this links up the script with the proper account).<\/li>\n<li>You will see &#8220;This app isn&#8217;t verified&#8221;.\u00a0 Click Advanced. Click Go to XXXX Project (unsafe).<\/li>\n<li>Click ALLOW<\/li>\n<li>Save your project again.<\/li>\n<li>Go to &#8220;Run-&gt;Run Function-&gt;createTimeDrivenTriggers&#8221;<\/li>\n<li>Hit the &#8220;Timer&#8221; icon.<\/li>\n<li>You should see your project listed under &#8220;Triggers&#8221;<\/li>\n<li>Your job is now scheduled to run every 1 hour and empty your trash!<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>This process was crafted by deciphering the following two pages:<\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/32749289\/automatically-delete-file-from-google-drive-trash\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/stackoverflow.com\/questions\/32749289\/automatically-delete-file-from-google-drive-trash<\/a><\/p>\n<p><a href=\"https:\/\/stackoverflow.com\/questions\/25749906\/permanently-delete-file-from-google-drive\/32749203\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/stackoverflow.com\/questions\/25749906\/permanently-delete-file-from-google-drive\/32749203<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Want to empty your Google Drive Trash automatically?\u00a0 I finally have the solution for you. Make sure you use GOOGLE CHROME web browser for best results. Open Chrome and go to www.google.com Make sure you are signed into your Google account.\u00a0 If not, sign in. You should OBVIOUSLY have Google Drive account up and running since that&#8217;s why you&#8217;re here,<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[138,137],"class_list":["post-583","post","type-post","status-publish","format-standard","hentry","category-random-bits","tag-google-apps-script","tag-google-drive"],"_links":{"self":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/583","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/comments?post=583"}],"version-history":[{"count":13,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions"}],"predecessor-version":[{"id":598,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/posts\/583\/revisions\/598"}],"wp:attachment":[{"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/media?parent=583"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/categories?post=583"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amixa.com\/blog\/wp-json\/wp\/v2\/tags?post=583"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}