If you want to rename the selected file in the Finder, don’t use UI actions, use the Finder Selection actions.
For more information, see the wiki Searching the Forum for Answers section.