"path to me" and "path to resource" do not function properly...

when the script is called through an alias file as a folder action

This seems to be an obscure bug at least in Leopard.

I prefer creating aliases in the User Scripts folder and keep the original files in the Documents folder, since this makes it easier for me to backup the original files and allows more flexibility in terms of file organization (I can move around the files without worrying about breaking the aliases)

“path to me” generally functions well. It will return the path to the original file instead of the alias when executed through the Script Editor or the AppleScript menu extra. However, “path to me” will return the path to the alias when executed as a Folder Action.

Here is a simple script to illustrate this bug

on moving folder window for this_folder from original_bounds
	display alert (path to me as string)
end moving folder window for

Steps to reproduce the bug:

  1. Save the script in any folder other than the Folder Action Scripts folder
  2. Create an alias in the Folder Action Scripts folder
  3. Attach the script to your favourite folder
  4. Open up the folder and move its window

Strangely enough, this bug does not occur if an UNIX-style symlink (created using the ln -s command)instead of an alias is used to refer to the original script file