Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save christopheranderton/893c58801a504edbafcb to your computer and use it in GitHub Desktop.
Save christopheranderton/893c58801a504edbafcb to your computer and use it in GitHub Desktop.
Add a simple ”Touch” Service to your context menu (Right-Click Menu) in MacOS X (Tested in Mac OS X 10.10.5, but should work in older and newer versions as well) with Automator.app
  1. Open up Automator.app located in your Applications folder.
  2. Choose ”Service” in the dialog sheet when creating a new document.
  3. In the Services receives selected: menu at the top of the ”Canvas” on the right, change to ”Files & Folders”.
  4. In the sidebar to the left, search for Get Selected Finder Items
  5. Drag this Action to the ”canvas” on the right side.
  6. Again, go to the sidebar at the left and this time search for Run Shell Script
  7. Drag the Run Shell Script action to the ”canvas” on the right side.
  8. At the right in the Run Shell Script action, change the Pass input from to stdin to as arguments
  9. Copy paste this into the action text box, removing the Cat command in the text box:
for f in "$@"
do
	touch "$f"
done

Save the Service into /Users/yourusername/Library/Services. Test it by select a file(s) or folder(s) in the Finder and Right-Click and go to end at the Context menu labeled ”Services” and look for the name you gave your Service. If everything works alright, the selected file(s) or folder(s) should have updated modification dates. It doesn't alter the file(s) or folder(s) except the modification date.

@bladerun16
Copy link

Thanks, simple and clever!

@harry-at-cogwrite
Copy link

Once again I return to this -- my latest laptop needed my TouchItNow quickaction. I see from my 2020 notes, after first using in 2018, that there is no longer a "service" option I choose "workflow" and follow the steps exactly otherwise (it seems to just want a name and will store the file where it wants). I think i will look for an "automator" cookbook - this would be really powerful if I understood all it could do...
Screenshot 2024-07-20 at 5 24 40 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment