Thanks. It gave me the information I needed to solve the problem. I needed a short delay after renaming the file.
So to solve the original problem of duplicating and renaming a file to a new destination, without having a file with the old name in the destination folder or a file with the new name in the source folder, here is the script:
set source to (choose file)
set destination to choose folder
tell application "Finder"
set temp to (duplicate source to (path to temporary items from user domain) with replacing) as alias
delay 1
set name of temp to "new name." & name extension of temp
move temp to destination
end tell
Yes, this does have the risk of wiping out a file with the same name as the source file in the temporary folder; it also runs the risk of encountering a file with the new name in the temporary items folder, causing the script to error. Both risks are so miniscule as to not having any concerns about.
-- Michelle
--
America: A nation of people avoiding moderation like it's the plague.