Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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
3  
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

2 Answers 2

up vote 6 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 this is part of a recurring task then perhaps you could use this free touch tool:

http://www.macupdate.com/app/mac/32413/touch-files

Or, this AppleScript solution might work:

http://www.applefritter.com/node/13502

share|improve this answer
2  
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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.