Folder Size AppleScript

Hi
I found a terminal command to place a dot before a file name to hide the file.

mv oldFileName newFileName

it works great
but i was warn not to play with terminal commands.
can anybody tell me how can i do the same thing with applescript.

thanks

For a simple rename routine, I allways use the “mv” command. It is not dangerous. Teorically, if you use “mv” to “move” a file across a file system, you will loss the resource fork of the file, since it uses really “cp” plus “mv”, according to mv’s man page. For such task you can use instead “ditto”, which will preserve the resource fork (useful for, eg, carbon apps, etc.). See “man ditto” in a Terminal window.

However, regarding your original question:

tell app "Finder" to set name of alias "path:to:file" to ".newname"

At least on my own tests, this method won’t affect the visibility of the file.

You can also try the method described here:
http://macscripter.net/faq/general.php?id=P39
Though it requires Developer Tools installed or, at least, a copy of SetFile.