Sign in to follow this  
Followers 0
AndrewB

newbie problem with window focus

3 posts in this topic

I have a little script to allow me to transpose mistyped pairs of characters when filling out forms or taking notes:

; experimental autoit script
AutoItSetOption("WinTitleMatchMode",4)
WinWaitActive("[REGEXPTITLE:EverNote|Firefox\z]")
; MsgBox(1,"Gotcha","Evernote / Firefox window active")
; goaway()

HotKeySet("{F4}","Transpose")
HotKeySet("!^e","goaway")

Func Transpose()
    Send("{SHIFTDOWN}{RIGHT}{SHIFTUP}^x{LEFT}^v")
EndFunc

Func goaway()
    Exit
EndFunc

And it works up to a point -- ie when either Firerfox or Evernote has focus, F4 is turned into a hotkey to transpose things.

But what I would like to know is how to turn off this assignment when those windows no longer have the focus,and other programs want F4 to do useful things. I'm sure this ought to be really obvious, but I can't figure it out, and would be grateful for any help and advice.

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

; experimental autoit script
AutoItSetOption("WinTitleMatchMode",[HBYÚ[]J ][ÝÖÔQÑVUN]Ý_YÞ   ÌLÞI]÷C²FVà¢÷D¶W6WBgV÷C·´cGÒgV÷C²ÂgV÷CµG&ç7÷6RgV÷C²¢!½Ñ-åMÐ ÅÕ½ÐìÌÌíyÅÕ½Ðì°ÅÕ½Ðí½ÝäÅÕ½Ðì¤(±Í(!½Ñ-ået("{F4}")
        HotKeySet("!^e")
    EndIf
    SY
L
BÑ[[È[ÜÜÙJ
BÙ[
    ][ÝÞÔÒQÕÓ^ÔQÒ^ÔÒQTW´ÄTeGÕçbgV÷C²¤VæDgVæ2³ÓÒfwCµG&ç7÷6P ¤gVæ2vöv¢W@¤VæDgVæ2ìôôÐí½Ýä

Edit: Welcome to the forum :-)

Edited by herewasplato

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites

; experimental autoit script
AutoItSetOption("WinTitleMatchMode",[HBYÚ[]J ][ÝÖÔQÑVUN]Ý_YÞ   ÌLÞI]÷C²FVà¢÷D¶W6WBgV÷C·´cGÒgV÷C²ÂgV÷CµG&ç7÷6RgV÷C²¢!½Ñ-åMÐ ÅÕ½ÐìÌÌíyÅÕ½Ðì°ÅÕ½Ðí½ÝäÅÕ½Ðì¤(±Í(!½Ñ-ået("{F4}")
        HotKeySet("!^e")
    EndIf
    SY
L
BÑ[[È[ÜÜÙJ
BÙ[
    ][ÝÞÔÒQÕÓ^ÔQÒ^ÔÒQTW´ÄTeGÕçbgV÷C²¤VæDgVæ2³ÓÒfwCµG&ç7÷6P ¤gVæ2vöv¢W@¤VæDgVæ2ìôôÐí½Ýä

Edit: Welcome to the forum :-)

Thank you. I'm sorry to have been so stupid. Now I will try and get the case-changing macro to work, though I suspect that may be a little ambitious ...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0