{"id":1719,"date":"2019-07-12T13:46:26","date_gmt":"2019-07-12T18:46:26","guid":{"rendered":"https:\/\/westerman.photo\/?page_id=1719"},"modified":"2019-07-12T13:47:45","modified_gmt":"2019-07-12T18:47:45","slug":"using-touch-as-a-mac-osx-service-in-finder","status":"publish","type":"page","link":"https:\/\/westerman.photo\/index.php\/using-touch-as-a-mac-osx-service-in-finder\/","title":{"rendered":"Using &#8220;touch&#8221; as a Mac OSX Service in Finder"},"content":{"rendered":"\n<p>If you are like me  you find yourself at the command line to do things you learned 30+ years ago. Or maybe you do things at the command line you learned last year! Yesterday?<\/p>\n\n\n\n<p>Well, if you&#8217;re lazy like me you&#8217;ve come to the right place to learn how to do this.<\/p>\n\n\n\n<p>I use &#8220;touch&#8221; all the time to bring the file date\/time up to &#8220;now&#8221;. This will sort my files to what I&#8217;m working on right now when I look at them in Finder.<\/p>\n\n\n\n<p>Like so many other hours in a day I finally came to the realization that I could code this with automator very simply and easily. It turns out I was right.<\/p>\n\n\n\n<p>The idea is to use automator to run a BASH script to do this for you.  Here is that process.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>Open up Automator.app located in your Applications folder.<\/li><li> Choose \u201dService\u201d in the dialog sheet when creating a new document.<\/li><li> In the Services receives selected: menu at the top of the \u201dCanvas\u201d on the right, change to \u201dFiles &amp; Folders\u201d.<\/li><li> In the sidebar to the left, search for Get Selected Finder Items<\/li><li> Drag this Action to the \u201dcanvas\u201d on the right side.<\/li><li> Again, go to the sidebar at the left and this time search for Run Shell Script<\/li><li> Drag the Run Shell Script action to the \u201dcanvas\u201d on the right side.<\/li><li> At the right in the Run Shell Script action, change the Pass input from to stdin to as arguments<\/li><\/ol>\n\n\n\n<p>You are going to install this script code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">for f in \"$@\"\ndo\n    touch \"$f\"\ndone<\/pre>\n\n\n\n<p>The code is simple. It just says &#8220;take this list&#8221; and &#8220;touch&#8221; each one of them.<\/p>\n\n\n\n<p>Here is what it&#8217;ll look like in automator:<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"890\" src=\"https:\/\/westerman.photo\/wp-content\/uploads\/Screen-Shot-2019-07-12-at-14.07.51-1024x890.png\" alt=\"\" class=\"wp-image-1720\" srcset=\"https:\/\/westerman.photo\/wp-content\/uploads\/Screen-Shot-2019-07-12-at-14.07.51-1024x890.png 1024w, https:\/\/westerman.photo\/wp-content\/uploads\/Screen-Shot-2019-07-12-at-14.07.51-300x261.png 300w, https:\/\/westerman.photo\/wp-content\/uploads\/Screen-Shot-2019-07-12-at-14.07.51-768x668.png 768w, https:\/\/westerman.photo\/wp-content\/uploads\/Screen-Shot-2019-07-12-at-14.07.51.png 1992w\" sizes=\"auto, (max-width: 706px) 89vw, (max-width: 767px) 82vw, 740px\" \/><\/figure>\n\n\n\n<p>Since this is something I&#8217;ll use every day I figured I would publish it. No rocket science here but very helpful repetitive task perfect for a computer to do every day for you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are like me you find yourself at the command line to do things you learned 30+ years ago. Or maybe you do things at the command line you learned last year! Yesterday? Well, if you&#8217;re lazy like me you&#8217;ve come to the right place to learn how to do this. I use &#8220;touch&#8221; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/westerman.photo\/index.php\/using-touch-as-a-mac-osx-service-in-finder\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Using &#8220;touch&#8221; as a Mac OSX Service in Finder&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1719","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/pages\/1719","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/comments?post=1719"}],"version-history":[{"count":2,"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/pages\/1719\/revisions"}],"predecessor-version":[{"id":1723,"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/pages\/1719\/revisions\/1723"}],"wp:attachment":[{"href":"https:\/\/westerman.photo\/index.php\/wp-json\/wp\/v2\/media?parent=1719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}