Create a new Quick action using MacOS Automator that allows you to "touch" a file or folder
- Open up Automator.app from your Applications folder or through Launchpad
- Create a new workflow using File > New (⌘N)
- Choose ”Quick Action” in the dialog sheet when creating a new document
- In the
Workflow receives currentdropdown menu at the top of the "Canvas" on the right, select ”Files or Folders”. - In the sidebar to the left, search for
Get Selected Finder Items - Drag this Action to the "canvas" on the right side
- In the sidebar to the left, search for
Run Shell Script - Drag this Action to the "canvas" on the right side
- In the
Run Shell Scriptaction in the right-hand panel, change thePass inputfromto stdintoas arguments - Remove the
Catcommand 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.
To find out more information about the MacOS Touch command, open terminal and use the man touch command to view the Touch manual.
