Issue with renaming file with applescript
This seems very silly to ask, but I am VERY new to apple scripts and trying to learn.
I get an error with the following script. I am setting it up in automator to take a file dropped into a folder with folder actions set up. But I keep getting a "Unspecified error"
It should take the file and rename it to the contents of the text in the clipboard and preserve the extension.
tell application "Finder" to activate
tell application "Finder"
set theExt to name extension of theFile
set the clipboard to «class ktxt» of ((the clipboard as text) as record) # remove styles from the clipboard
set theNewname to the clipboard
set name of theFile to theNewname
set name extension of theFile to theExt
end tellAny help would be appreciated
Mac OS X (10.5)