1

I want to combine the following two scripts into one:

How can I do this?

Note that whenever I use these AutoHotkey scripts with form input, it presses the Enter key automatically which I don't want.

0

Select text, press Alt-R

Converts:
"My Filename" to "my-filename"
"MY FILENAME" to "my-filename"
"my filename" to "MY-FILENAME"
Preserves original clipboard contents

#SingleInstance Force

!r::
save := ClipboardAll
Send ^c
clipwait
original_filename := Clipboard
StringReplace, hyphen_filename, original_filename, %A_SPACE%, -, All
StringLower, hyphen_filename_toggle, hyphen_filename
If (hyphen_filename_toggle == hyphen_filename)
{
    StringUpper, hyphen_filename_toggle, hyphen_filename
}
Clipboard := hyphen_filename_toggle
Send ^v
Clipboard := save
return
  • Tested and working. Based on the two linked scripts of John T. – RJFalconer Jan 1 '10 at 17:46
  • Sorry i was out from city to celebrate party. yes it's working thanks – metal gear solid Jan 4 '10 at 9:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.