I use Cmd+L to make a alias, and the alias has "alia" appended to the original file name. I move the link to a directory, then remove the "alias" part manually.

Is there a tool that can do this kind of automatically? I mean, if a tool can catch the event a file is copied to a specific directory to call a tool (python, ruby or applescript) with a parameter, I can easily rename the file name.


Thanks to Ben and Dori, I could get it working.

  1. Go to /Library/Scripts/Folder Actions directory to Folder Actions Setup.
  2. Run Automator
  3. Utilities -> Run Shell Script
  4. Use python as a shell, and pass input should be as arguments
  5. Run the following code
import sys
import os

for f in sys.argv[1:]:
    (name, ext) = os.path.splitext(f)
    newname = "%s%s" % (name, ".pdf")
    os.rename(f, newname)

Philip's method should work, but I think Automator is easier to get it work. On my Snow Leopard, I couldn't see the folder action context menu.


In addition to Applescript, Automator allows you to create Folder Actions as well, at least in 10.6. (This should have been a comment on Philip's post, but I don't quite have enough rep for that yet.)

  • +1 Automator might be the easier of the two ways to do this. I don't use it because my daily needs are for more advanced and I sometimes forget it even exists. Oct 7 '10 at 19:22

I'm not sure what you're using to make symbolic links (it's not built in to OS X), so I can't say if something could be added at that step.

For Folder Actions, the three places to look are:

  • /Library/Scripts/Folder Actions
  • /Library/Scripts/Folder Action Scripts
  • /Library/Scripts/Script Editor Scripts/Folder Actions Handlers

In the first folder, you'll find Configure Folder Actions - run that, and you can enable folder actions, including choosing folders and what scripts apply to those folders.

The last two folders will give you some places to start writing the script you want.

You must log in to answer this question.

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