Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

iSwitchw - cosmetically enhanced edition


  • Please log in to reply
43 replies to this topic
alias
  • Members
  • 4 posts
  • Last active: Apr 07 2012 12:41 PM
  • Joined: 25 Jun 2010
Maybe my last question was too verbose, since nobody responded. I'm wondering if there's a way to modify this script so the window activated before the currently activated one is at the top? That way, you could invoke iSwitchW and hit Enter to duplicate the standard functionality of Alt-Tab. If I could use it for that, I'd replace Alt-Tab with iSwitchW altogether.

Thanks,

Mark

SoLong&Thx4AllTheFish
  • Members
  • 4999 posts
  • Last active:
  • Joined: 27 May 2007
@Mark Alias: there is a line somewhere around 459 or so
Sort, winlist, D|
place a ; at the beginning to comment it, that might work
; Sort, winlist, D|


alias
  • Members
  • 4 posts
  • Last active: Apr 07 2012 12:41 PM
  • Joined: 25 Jun 2010
@hugov: Thanks very much for the help - I hadn't thought it could be that simple...

I commented out the sort statement as you suggested, and changed this line around 505
    GuiControl, Choose, ListBox1, 1
to
    GuiControl, Choose, ListBox1, 2
With the sort statement commented out, when iSwitchW displays the window titles, they're in last-used order by default, and the one used previously to the current one is highlighted instead of the current window, so all I have to do is press Enter.

It's not quite as fast as just typing Alt-Tab, but it's only one extra keystroke, Enter, so that's an excellent tradeoff.

Thanks again!

Mark

alias
  • Members
  • 4 posts
  • Last active: Apr 07 2012 12:41 PM
  • Joined: 25 Jun 2010
I had to include an if-else to make it work properly:
    if search =
        GuiControl, Choose, ListBox1, 2
    else

goes in front of the original GuiControl, Choose, Listbox1, 1 line...

That seems to do the trick.

Maj.Boredom
  • Guests
  • Last active:
  • Joined: --

I get only a blank window when I use this script. The "Window Switcher" dialog comes up, but it is completely blank.

Any ideas? I tried the original version of this script as well and it did the same thing.


I too only get a blank window. Has anyone had success with this script with Win 7? I'm guessing that is the problem, but I don't have time to debug this now.


Make sure there is no other script with a "return" line above the part where you pasted in iSwitchw, or the initialization part of iSwitch (the part at the beginning outside of any blocks) will not run. That solved it for me.

latinsud
  • Members
  • 2 posts
  • Last active: Apr 30 2008 07:24 PM
  • Joined: 30 Apr 2008
This script is gold. I was about to create one to do the same (task swithing by typing the title of the window).

Btw, i modified it to use LWin key instead.
I wanted to be able to cancel by pressing the same key again, but i found i cannot intercept the key while executing the action for the key itself. So my changes are:

Remove:
CapsLock::
Add:
~LWin:: 
Send {Esc}

Add:
    if ErrorLevel = EndKey:lwin
    {        
        Gui, cancel 
	Send {LWin}
        break 
    } 

    if ErrorLevel = EndKey:rwin
    { 
       
        Gui, cancel 
	Send {RWin}
        break 
    } 


dblanchard
  • Members
  • 32 posts
  • Last active: Jul 16 2014 01:43 AM
  • Joined: 14 Feb 2007
Excellent script. I can't wait to stop using alt-tab. However, i can't get the last-used sorting to work.

@hugov:
With the sort statement commented out, when iSwitchW displays the window titles, they're in last-used order by default, and the one used previously to the current one is highlighted instead of the current window, so all I have to do is press Enter.


Mark, I followed your instructions, but my sort order hasn't changed. I also tried Alias' code, but can't get it. Would one of you please post your code in its entirety?

BTW, I use "capslock & f" as my trigger. No loss of other keys that I use, like left Windows key, and I never accidentally hit it.

Thx,

D

Skrell
  • Guests
  • Last active:
  • Joined: --
I know VERY little about autohotkey, but i was hoping to make a very small change to this script so that the TAB button functions like a down arrow, however when i tried simply replacing EndKey:down with EndKey:tab i get weird behavior? Any help would be apprecaited!

jixiuf
  • Members
  • 48 posts
  • Last active: Dec 24 2015 01:57 AM
  • Joined: 16 May 2011
<!-- m -->http://www.autohotke... ... highlight=<!-- m -->
<!-- m -->http://www.autohotke... ... highlight=<!-- m -->

Skrell
  • Guests
  • Last active:
  • Joined: --
wow thanks!!

yogi
  • Members
  • 15 posts
  • Last active: Dec 22 2011 03:33 PM
  • Joined: 02 Sep 2007
I modified the appearance of the gui in 2 places,

to hide the margin as well as default the colors to system color for background.

Gui, +LastFound +AlwaysOnTop -Caption    
Gui,Font,s12 cGreen bold,Verdana
Gui, Margin , 0, 0
Gui, Add, ListBox, vindex gListBoxClick w600 h500 AltSubmit -VScroll

to make it appear in the center,
Gui, Show, Center h500 w600, Window Switcher

This is very nice. I wish I knew enough of ahk to add an edit box right above the listbox which shows what I am typing (if I typed something wrong). I will have to learn! :)

Oh, and if anyone sees the File Switcher in notepad++ , duplicating that switcher and adapting it to become a window switcher would be great (with its relevant options).
I guess I will try this, when I become better with ahk.

Thanks for sharing this script!!
no fate but what we make

jeg
  • Guests
  • Last active:
  • Joined: --
This script is simply brilliant, Thank you ezuk!

I wonder if it'd be possible to use other keys as alternative to up/down, for example numpadadd/numpadsub.

I tried to achieve this myself, substituting line 190 with

Input, input, L1, {enter}{esc}{backspace}{numpadsub}{numpadadd}{pgup}{pgdn}{tab}{left}{right}

and line 235 with

if ErrorLevel = EndKey:numpadadd

and similarly for the ErrorLevel entry for {up}, but it doesn't work (I don't master autohotkey to the point of understanding why).

Any suggestions?
Cheers!

xnsua
  • Members
  • 4 posts
  • Last active: Dec 01 2013 05:16 AM
  • Joined: 01 Nov 2013

Change to this block in the file about line 697

ListBoxClick:
if (A_GuiControlEvent = "Normal"
    and !GetKeyState("Down", "P") and !GetKeyState("Up", "P") and !GetKeyState("Tab", "P"))
    send, {enter}
return

I know VERY little about autohotkey, but i was hoping to make a very small change to this script so that the TAB button functions like a down arrow, however when i tried simply replacing EndKey:down with EndKey:tab i get weird behavior? Any help would be apprecaited!



ckl5
  • Members
  • 1 posts
  • Last active: Dec 23 2015 05:47 PM
  • Joined: 23 Dec 2015

Hi all, I am a newbie to AHK and have an existing script for simple tasks file in my home directory.

 

I really would like to use iswitchw but would need instructions on how to install it.

 

E.g. I am not sure whether I need a separate script file. Will this script interfere with my existing ones (eg I have a few hotstrings and they need to come at the beginning)?

 

Many thanks in advance!

Christian