2

I am looking for a Windows 7 program that allows me to press a shortcut, get asked to input a character and have the currently selected text surrounded with what I entered.

I need:

  • it to be free
  • it to run on Windows 7
  • it to be triggered with a configurable shortcut
  • it to ask me what I want the text to be surrounded with

eg. I select sample text, press a shortcut, enter " into an input box and the text now is "sample text"

2

It can easly be done with AutoHotkey.

AutoHotkey (AHK) is a free, open-source macro-creation and automation software for Windows that allows users to automate repetitive tasks. It is driven by a scripting language that was initially aimed at providing keyboard shortcuts, otherwise known as hotkeys, that over time evolved into a full-fledged scripting language.

Here is a script:

#i::

    clipsaved:= ClipboardAll

    Send, ^c
    WinGetTitle, CurrentWinTitle

    InputBox, inputVar, Input character, Input character wich will surround the text.
    clip := Clipboard
    clip = %inputVar%%clip%%inputVar%

    Clipboard := clip

    WinActivate, %CurrentWinTitle%
    Send, ^v

    Clipboard := clipsaved

return

Keep in mind that script works through manipulating clipboard. It tries to restore it but anyway be aware that it can change clipboard.

  • Could you give me a starter script if possible? I really don't understand AHK script that much to create what seems like a complex script! – ᔕᖺᘎᕊ Apr 20 '15 at 16:23
  • @ᔕᖺᘎᕊ what shortcut you need? I mean which hotkeys? – vasili111 Apr 20 '15 at 16:28
  • @ᔕᖺᘎᕊ Which hotkeys should launch script? – vasili111 Apr 20 '15 at 16:32
  • I'll be able to change the shortcut keys - but if you can, say something like Win+I? – ᔕᖺᘎᕊ Apr 20 '15 at 18:05
  • 1
    @ᔕᖺᘎᕊ I edited my answer and added the script. – vasili111 Apr 20 '15 at 20:46

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.