0
votes

I'm new to Autohotkey, tried to make a macro to:

  1. Copy selection

  2. Paste it in Notepad++

  3. Playback Notepad++ macro (for formatting) shortcut: Ctrl+Shift+B

  4. Copy all the edited text

  5. Paste in Firefox text field

I tried starting with the following code, but I couldn't even get AHK to copy paste my selection to Notepad++.

^!x::

Send,  ^c

ClipWait 

IfWinExist, Notepad++

    {
    WinActivate
    Send  ^v
    }
1
Try with SetTitleMatchMode, 2Joe DF

1 Answers

2
votes

Always use AutoHotkey from http://ahkscript.org/ (current version, new official website)! AutoHotkey from autohotkey.com is outdated and you may have problems running some scripts with it!

Here is working script:

^!x::

Send, ^c

ClipWait 

SetTitleMatchMode, 2
IfWinExist, Notepad

    {
    WinActivate
    Send, ^v
    }

return

I added command SetTitleMatchMode, 2 as Joe DF mentioned in comments. That command (link) with parameter 2 sets the matching behavior of IfWinExist command so that a window's title can contain WinTitle anywhere inside it to be a match. Also added return in the end.