PDA

View Full Version : Applescript to rename files on external drive




wesg
Nov 7, 2008, 07:00 PM
I wrote an applescript that does everything i want on the startup drive. It takes the selected files, processes them, and renames them. But so far, I have not been able to get it working on my external drive.

I believe it has something to do with the path. On the internal startup drive, I used a path like "Macintosh HD:Users:username:desktop:file.txt" and it works fine.

How can I use this on the external drive? Using "Volumes:Hard Drive:Files:file.txt" doesn't work. neither does replacing the : with /. Any suggestions?



HiRez
Nov 7, 2008, 08:09 PM
Have you tried using / (starting with /Volumes) and declaring it as a "POSIX path"? As a test you might use a choose file dialog, choose the file on the external drive, and see what path it returns.

wesg
Nov 7, 2008, 08:55 PM
Way to go, HiRez, you did it!

Once I did the choose file dialog, I found out that the path doesn't even use /Volumes/. I removed that from the file path in the script, and bingo, problem solved.

Thanks!