Home » Questions » Computers [ Ask a new question ]

How can I combine two AutoHotkey scripts into one?

How can I combine two AutoHotkey scripts into one?

I want to combine the following two scripts into one:

Asked by: Guest | Views: 235
Total answers/comments: 1
Guest [Entry]

"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"