Rename
This simple apple script mimics the way windows rename works. I wasn't
aware of this win features, and before I did solve this kind of problems with pure shell works.
This is a pure AppleScript solution.
Rename.applescript (download)
(*
* Enrico Franchi ©2005
* This is Public Domain
*)
tell application "Finder"
set mySel to selection
display dialog ¬
"Rename file with:" default answer ¬
"" buttons {"OK", "Cancel"} ¬
default button "OK"
set basename to text returned of result
if basename is equal to "" then
return
end if
set j to 0
repeat with i in mySel
set ext to name extension of i
if ext is not equal to "" then
set ext to "." & ext
end if
if j is greater than 0 then
set defname to (basename & j as text) & ext
else
set defname to basename & ext
end if
set j to j + 1
set name of i to defname
end repeat
end tell