Windows switching - hot to make it work

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
STEPECEN
Posts: 1
Joined: 25 Dec 2016, 11:23

Windows switching - hot to make it work

27 Jan 2017, 08:12

I made a short macro to be used to copy/paste line from notepad to a field in browser.
First part works fine
F2 selects line, copies it to clipboard, switch to chrome, select the entire field, clear it and past the clipboard, send Ctrl+Enter.
But from here, it does not work.
What I would like to achieve, is to switch back to notepad...
F3 is almost the same, except that, firstly I need to manually select the text in notepad (either shorter than a line, or several lines), then everything is done the same way...
Once again - after sending the Ctrl+Enter it does not work any more
; Copy and paste into Memoq
F2::
WinActivate, ahk_class Notepad++
; Select line (for short lines only)
SendInput +{Home}
SendInput +{Down}
Sleep 50
SendInput ^x
Clipwait
; Activate smartcat window
WinActivate ahk_class Chrome_WidgetWin_1
WinWaitActive ahk_class Chrome_WidgetWin_1
Sleep 500
; Paste copied line
SendInput ^a
Sleep 50
SendInput {Delete}
Sleep 50
SendInput ^v
Sleep 50
WinActivate, ahk_class Notepad++
WinWaitActive A, ahk_class Notepad++
Sleep 50
return

F3::
WinActivate, ahk_class Notepad++
Sleep 50
SendInput ^x
Clipwait
; Activate smartcat window
WinActivate ahk_class Chrome_WidgetWin_1
WinWaitActive ahk_class Chrome_WidgetWin_1
; Paste copied line
SendInput ^a
Sleep 50
SendInput {Delete}
Sleep 50
SendInput ^v
Sleep 5000
WinActivate, ahk_class Notepad++
WinWaitActive A, ahk_class Notepad++
Sleep 50Sleep 50
return

Stefan Pecen, simulta, Bratislava, Slovakia

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Anput, Google [Bot] and 114 guests