how to change file extension name

Hi,
I am creating an applescript from filemaker pro that renames a file. Thanks to this forums help, I have that working. Now I need to change the file externsion of the renamed file. Any ideas??
My script so far looks like this.

tell application “Finder”
activate
set name of document file “untitled.tab” of folder “Desktop” of folder “ianslater” of folder “Users” of startup disk to (the clipboard as text)

end tell

Thank you,

ian

I’m sure there’s a better way to do it, but until someone chimes in, try inserting the following before the line that starts with “set name…”

do shell script “mv ~/Desktop/untitled.tab ~/Desktop/untitled.xyz”

where xyz is the desired new extension.

Although I see nothing wrong with the shell option, here’s an AS option.

tell application "Finder"
	set myFile to (document file "untitled.tab" of folder "Desktop" of folder "ianslater" of folder "Users" of startup disk)
	set origName to (name of myFile)
	set short_origName to text 1 through -5 of origName
	set name of myFile to (short_origName & ".xyz")
end tell

(In fact, I like the shell method due to its extreme brevity. What’s not to like? :wink: )