Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've encountered a situation where a Mac user needs to update the modified time of a file. If I was doing this, I'd just open up Terminal, cd to the file, and use the touch command. However, the person doing this is not me and I'd like to avoid making their lives more complicated with Linux commands. So, is there a simple way to touch a file from the OS X UI? This user will either be using Snow Leopard or Lion.

share|improve this question
Opening the file, changing something, saving, undoing the change, and saving again isn't an option? – Daniel Beck May 24 '12 at 17:07
It's an audio file for one thing, which makes changing it a little dicier. That said, if I can provide them with a solution that doesn't involve opening another program, that'd be optimal. – abeger May 24 '12 at 17:10
up vote 8 down vote accepted

Open Automator and create a new Application.

From the Library, add a Run Shell Script action that receives input as arguments.

Change the sample script from cat to touch and save, e.g. as Update Time anywhere on your system.

Zip the created application (File » Compress "Update Time" in Finder) and email the .zip file to your user with the instructions to:

  1. Save the attachment to the Downloads folder
  2. Double-click the saved file to extract the application
  3. Drag & drop the audio file onto the application (with the robot icon)
share|improve this answer
This worked great for me. A note to anyone else following these instructions: Make sure you change the input type BEFORE you change the cat to touch. – abeger May 25 '12 at 19:36
If you want to use this yourself, an even easier method is to select 'service' instead of 'application'. Say that it accepts files/folders from finder as input. Then create the service the same way as Daniel Beck describes. Then save and call it 'Touch'. Then in finder you can just right click on a file and 'Touch' will appear in the menu. – Daniel Howard May 31 at 11:19

If this is part of a recurring task then perhaps you could use this free touch tool:

Or, this AppleScript solution might work:

share|improve this answer
Your "AppleScript solution" is for Mac OS 9, obsolete for over a decade. The first link points to an Automator action, which requires understanding of Automator to use. Have you even looked at those before posting? – Daniel Beck May 24 '12 at 17:21
Yikes, sorry, I didn't notice it said OS 9 on the AppleScript solution (I found that right before I posted so I threw it in). As for the Automator solution, I just figured that if this was a recurring task it might be worth taking the time to setup for your user(s). However, based on what you're saying, a recurring solution isn't useful here. – Jeremy May 24 '12 at 17:48
It'd make sense for the case where you'd set it up for yourself, not like the user asked. I don't think there's a really immediate solution to do this on the GUI, unfortunately. The shell solution I describe would survive Automator action format changes, while being a bit more complicated to set up. – Daniel Beck May 24 '12 at 17:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .