Rename folder in Finder

How do you rename a folder located on the desktop. For convience could you please use the name “Untitled” as the folder’s name and have it located in ~/Desktop/ and rename the folder to “Renamed”

Thanks, Terry


A quick search of this board for the words “rename” AND “folder” would have resulted in a quick answer and should be the first thought when anyone has a question to post–especially one so basic about renaming a folder or file. That said, here is code that will do what you want: