This script works as mentioned on a previous question to add @2x to all files in a folder, BUT how do I make or change this apple script to remove the @2x.
set appendable to "@2x"
set theFolder to choose folder
tell application "Finder"
set theFiles to (files of entire contents of theFolder) as alias list
repeat with theFile in theFiles
set FileExtension to theFile's name extension as string
set FileName to theFile's name as string
set FileBaseName to text 1 thru ((offset of "." in FileName) - 1) of FileName
set theFile's name to FileBaseName & appendable & "." & FileExtension
end repeat
end tell
It would be easier to do it in a shell:
IFS=$'\n'; for f in $(find ~/Desktop -name '*@2x*'); do mv "$f" "${f//@2x/}"; done.