user2737041
user2737041

Reputation:

How to activate a window after it has lost focus?

So i am using this great software called Website-Watcher, which is rss feed reader and web content tracker.

I have configured it to open external links in firefox, which is opening tabs in the background.

BUT the problem is that Website-Watcher looses focus after i hit some link, so is there a way to open a link, regain lost focus and send click to be able to scroll, i have found a script that activates window on mouse scroll BUT the scroll functionality of program is not regained.

Please, give me some ideas!

EDIT UPDATE::: I have finally made it work, the problem was with the Windows 8.1 Admin rights, because i run Website-Watcher elevated, script that i was using stopped working.

The scripts are here:

http://www.autohotkey.com/board/topic/6292-send-mouse-scrolls-to-window-under-mouse/ http://www.autohotkey.com/board/topic/99405-hoverscroll-verticalhorizontal-scroll-without-focus-scrollwheel-acceleration/?p=623967

With those scripts you can perform scroll without activating windows or if you use the former you can even activate windows with mouse scroll.

Upvotes: 3

Views: 11590

Answers (3)

user3672222
user3672222

Reputation: 1

Use "WinGet, variableName , List, yourWindowName" (without quote)

then call your variableName contate it with 1 in every ControlSend

for example :

WinGet, nexid, List, myHyperTerminal

ControlSend, , {shift down}at=cmgs{shift up}=303{ENTER},  ahk_id %nexid1%
sleep, 1000
ControlSend, , {shift down}sms{shift up}{space}10000,  ahk_id %nexid1%
sleep, 1000

if you want to use control key such as shift, ctrl, alt, don't forget to add "SetKeyDelay, intDelay, intPressDuration" (without quote)

for example the script will be list this

#usehook on
SetKeyDelay, 50, 20
WinGet, nexid, List, zz1

$F6::

ControlSend, , {shift down}at=cmgs{shift up}=303{ENTER},  ahk_id %nexid1%
sleep, 1000
ControlSend, , {shift down}sms{shift up}{space}10000,  ahk_id %nexid1%
sleep, 1000

return
$F7::pause

it will be sent to active/inactive window "zz1" as :

AT+CMGS=303
SMS 10000

Upvotes: 0

Sparx
Sparx

Reputation: 66

Use WinActivate

For example, WinActivate Untitled - Notepad would activate (bring focus to) the window "Untitled - Notepad". This title must be exact and is case-sensitive.

Upvotes: 3

Dane
Dane

Reputation: 1211

It might be easiest to do this in a low-tech way. I'm not familiar with Website-Watcher, so I'll share a script I use that you should be able to adapt.

I use Feedly in Chrome for RSS reading, and hitting "v" in Feedly opens the story in a new tab. I use my Media Play button to hit "v" and bring me back to Feedly:

Media_Play_Pause::
send v
sleep 50
send {Ctrl Down}{Shift Down}{Tab}{Shift Up}{Ctrl Up}
return

So, define your hotkey, have it trigger the link to open in Firefox, and then hit Alt-Tab to jump back:

X::
send y
sleep 50
send {Alt Down}{Tab}{Alt Up}
return

Obviously, replace "X" and "y" above.

I don't care about using my Media Play button for anything else, but if you want your hotkey to be context sensitive, use #IfWinActive.

Upvotes: 0

Related Questions