set the clipboard to (do shell script "echo " & quoted form of (get the clipboard) & " | tr A-Z' ' a-z-")
tell application "System Events"
set currentApplication to name of 1st process whose frontmost is true
tell process currentApplication to keystroke "v" using command down
end tell
the script must be run from the script menu. It won’t work when you run it in Script Editor
I don’t like to use third party products when I write scripts for users asking in forums.
Most of the time they don’t know what they are.
With a bit of luck, I remembered an old script which I posted at the end of 2008 on an other forum.
--[SCRIPT]
set leNom to my convert("THIS IS AN UPPERCASE FILE NAME_ÉÈÀÒÙÌÂÊÎÔÄËÃÖÜÆŒÃÕÃAÉÃIËœ.png", "lower")
on convert(n, choix)
--choix = "lower"
--set choix = "upper"
--set choix = "title"
return (do shell script "/usr/bin/python -c \"import sys; print unicode(sys.argv[1], 'utf8')." & choix & "().encode('utf8')\" " & quoted form of n)
end convert
--[/SCRIPT]