Skip to content

Instantly share code, notes, and snippets.

@maddisondesigns
Last active September 26, 2025 06:56
Show Gist options
  • Save maddisondesigns/9f7fbe7217d1b964d69757578de553ea to your computer and use it in GitHub Desktop.
Save maddisondesigns/9f7fbe7217d1b964d69757578de553ea to your computer and use it in GitHub Desktop.
MacOS Automator Quick Action for Touching a File/Folder

Create a new Quick action using MacOS Automator that allows you to "touch" a file or folder

  1. Open up Automator.app from your Applications folder or through Launchpad
  2. Create a new workflow using File > New (⌘N)
  3. Choose ”Quick Action” in the dialog sheet when creating a new document
  4. In the Workflow receives current dropdown menu at the top of the "Canvas" on the right, select ”Files or Folders”.
  5. In the sidebar to the left, search for Get Selected Finder Items
  6. Drag this Action to the "canvas" on the right side
  7. In the sidebar to the left, search for Run Shell Script
  8. Drag this Action to the "canvas" on the right side
  9. In the Run Shell Script action in the right-hand panel, change the Pass input from to stdin to as arguments
  10. Remove the Cat command in the text box and copy/paste the following into the action text box:
for x in "$@"
do
  touch "$x"
done

Save the Workflow with an appropriate name such as "Touch File or Folder".

Test it by selecting a file(s) or folder(s) in the Finder and Right-Click. In the Quick Actions menu in the popup context menu, select your new action (Touch File or Folder).

If the action worked, the selected file(s) or folder(s) will have updated modification dates.

Screenshot

To find out more information about the MacOS Touch command, open terminal and use the man touch command to view the Touch manual.

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