#Persistent #SingleInstance, Force #NoEnv SetBatchLines, -1 SetWorkingDir, %A_ScriptDir% SendMode, Input ; Select the text and press Alt+v to convert space -> underscore ;#d:: !v:: Clipboard = Send, ^c ClipWait, 2 If ErrorLevel { TrayTip,, The attempt to copy text onto the clipboard failed. Return } StringReplace, Clipboard, Clipboard, %A_SPACE%, _, UseErrorLevel If ErrorLevel ; searchtext found { TrayTip,%ErrorLevel%,%Clipboard%,,1 ;num. of changes and new clipboard content } Else ;searchtext not found TrayTip,,%ErrorLevel%,,1 ;return errorlevel Return