Jump to content

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

cycleWindow()


  • Please log in to reply
26 replies to this topic
nimda
  • Members
  • 4368 posts
  • Last active: Aug 09 2015 02:36 AM
  • Joined: 26 Dec 2010
Please upload to <!-- w -->www.autohotkey.net<!-- w --> instead :roll:

TheGreatSwami Woo
  • Members
  • 237 posts
  • Last active: Jan 22 2012 03:31 PM
  • Joined: 26 May 2011
any advice on getting this to work if you dont use windows explorer but Total commander

JonS
  • Members
  • 49 posts
  • Last active: Feb 09 2018 07:45 PM
  • Joined: 10 Sep 2010
There. It's officially updated. :D

First-Post is changed as well, hopefully so that it's more understandable upon first-look.

any advice on getting this to work if you dont use windows explorer but Total commander


Yes, from from what I can tell about Total Commander here, the app always has the title "Total Commander", so if you just specify that in the first parameter, it should work.

CapsLock & Tab::cycleWindow("Total Commander")

Also, don't forget that you can use Window Spy, which you can launch from the right-click menu of a running AHK script's tray icon.

popeguy
  • Members
  • 7 posts
  • Last active: Dec 23 2011 02:49 AM
  • Joined: 15 Oct 2011
Hi Jon, script works awesomely. Just one question, I'm using this command:

Alt & Tab::cycleCurrentWindow()


but I want to exclude windows with the word "Lobby" in. How would I incorporate this?

Also is there a way to open the cycle menu and have it stay open without having to hold down ctrl or alt?

JonS
  • Members
  • 49 posts
  • Last active: Feb 09 2018 07:45 PM
  • Joined: 10 Sep 2010
Glad you like it. Have you tried this?

Alt & Tab::cycleCurrentWindow("| | Lobby")

As it has been set up, many aspects of behavior are not customizable without editing the core code itself. So...there's no easy way to make the listview stay open without having to hold down the key. It would involve editing the code.

Just to throw this idea out, if anyone cares to read, cycleWindow could be more customizable (and thus useful) if it was like an object class rather than one bloated function. A "WinCycleList" object, for example, could have methods like the following:


WinCycleList.create(title, regexp, pathtorun)
WinCycleList.show()
WinCycleList.selectNext()
WinCycleList.selectPrevious()
WinCycleList.activateSelected()
WinCycleList.close()

You could recreate the cycleWindow() function in just a few lines with these methods, and do a whole lot more. (Unfortunately, I have neither the time nor the familiarity with AHK's object stuff to work on it right now)

popeguy
  • Members
  • 7 posts
  • Last active: Dec 23 2011 02:49 AM
  • Joined: 15 Oct 2011
I tried adding that line of code but it still cycles through the windows, it just says "failed match". I've also tried it with windows explorer windows and again it gives me the "failed match". The code I'm using is exactly this:

#Include %A_ScriptDir%\cycleWindow.ahk
Ctrl & Tab::cycleCurrentWindow("| | Lobby")
return

#esc::ExitApp



JonS
  • Members
  • 49 posts
  • Last active: Feb 09 2018 07:45 PM
  • Joined: 10 Sep 2010
Oh, cycleCurrentWindow takes different parameters than cycleWindow. You are actually passing "| | Lobby" to a parameter for a regular expression (for title-trimming). The function cycleCurrentWindow cycles through windows that have the same class as the current active window.

Try using cycleWindow:
#Include %A_ScriptDir%\cycleWindow.ahk 
Ctrl & Tab::cycleWindow("| | Lobby") 
return 

#esc::ExitApp


TheGreatSwami Woo
  • Members
  • 237 posts
  • Last active: Jan 22 2012 03:31 PM
  • Joined: 26 May 2011
doesn't work, tried downloading the last version at the bottom of page one
At the top of the script is an include
#Include Thumbnail lib.ahk
; ^ Thumbnail lib.ahk can be found at <!-- m -->http://www.autohotke...pic.php?t=70839<!-- m -->

If you go to the link it tells you that it is only for Vista or WIN7

got it to work by commenting out the include and then had to go through the script and comment out several references to Thumbnail before it would work for me.

popeguy
  • Members
  • 7 posts
  • Last active: Dec 23 2011 02:49 AM
  • Joined: 15 Oct 2011

Oh, cycleCurrentWindow takes different parameters than cycleWindow. You are actually passing "| | Lobby" to a parameter for a regular expression (for title-trimming). The function cycleCurrentWindow cycles through windows that have the same class as the current active window.

Try using cycleWindow:

#Include %A_ScriptDir%\cycleWindow.ahk 
Ctrl & Tab::cycleWindow("| | Lobby") 
return 

#esc::ExitApp


Thought I'd try it out again and this works perfectly, thank you so much!

RT Wolf
  • Members
  • 1 posts
  • Last active: Jan 19 2014 06:53 AM
  • Joined: 17 Jan 2014

Signed up just to say thank you! This is super awesome.

 

A tip for those interested:

 

Instead of creating different hotkeys for each program, I wanted to have one hotkey I'd use to switch between all the windows of whatever program happened to be in front. I chose Ctrl+tab for programs that don't have tabbing built-in. AHK yelled at me for assigning duplicate hotkeys so I just put some #IfWinActive before the program call. Snippet from my do-it-all AHK file:

#Include cycleWindow.ahk

#IfWinActive ahk_class Notepad
^w::
Send !{F4}

;cycles through all notepad window
;(specifically, windows with "notepad" in their title)
Ctrl & Tab::cycleWindow("Notepad")

#IfWinActive ahk_class CabinetWClass
;cycles through all open windows of Windows Explorer
Ctrl & Tab::cycleWindow("ahk_class CabinetWClass")

And a question:  I'd like to use LWin & Tab but that's not working for some reason. Win7 has a built-in pretty app-switcher set to Win + Tab but that hotkey does nothing. It stops the built-in switcher from working, but doesn't switch windows.



fenderist
  • Members
  • 12 posts
  • Last active: Mar 17 2014 06:05 PM
  • Joined: 14 Jul 2010

Hi guys. Thanks for this awesome program. I am encountering some problems and I would be grateful if any of them can be answered

- `cycleCurrentWindow()` just switch back and forth between two windows. The switch window flickers with the rest of the matching windows, but it disappears before I let go of the key. I have disabled thumbnail, commented out the #include statement. I have turned off other autohotkey to isolate key conflict problem. 

- The "Thumbnail lib.ahk" is no longer available? I downloaded this one instead: https://github.com/m...b/Thumbnail.ahk

But the thumbnail does not work

- I was not able to map keys to Win key (`#`).

I am using Windows 7 x64



Skrell
  • Members
  • 384 posts
  • Last active: Jul 07 2016 05:03 PM
  • Joined: 23 Aug 2011

1.  Can someone please repost source for this?

2.  Does this script not work well with XP?  I saw posts saying they removed "Thumbnail.ahk" is that bc this library is only for vista/7 ?