I wrote up a quick script to reverse the name of a file.
I'm pretty pleased that I got it working without coming here.
Now that it is working, I figured I'd show it, and see if there was a better way to do it, or a way to optimize it.
The next stage is to turn it into a service so I can right click on a file and make it happen. I'm guessing Automater is the best way to do that or could it be done directly in the script.
I'm pretty pleased that I got it working without coming here.
Now that it is working, I figured I'd show it, and see if there was a better way to do it, or a way to optimize it.
Code:
set thefile to choose file
tell application "Finder"
set filename to name of thefile
set thePrefix to text 1 thru -5 of filename
set thesuffix to text -4 thru -1 of filename
set filenamereverse to reverse of characters of thePrefix as string
set newname to filenamereverse & thesuffix
set name of file thefile to filenamereverse & thesuffix
end tell
The next stage is to turn it into a service so I can right click on a file and make it happen. I'm guessing Automater is the best way to do that or could it be done directly in the script.