topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:53 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: Can FARR be used to switch between open windows?  (Read 19177 times)

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Can FARR be used to switch between open windows?
« on: August 06, 2009, 09:28 AM »
I was wondering if FARR can be used to duplicate the functionality of the iSwitchW AutoHotKey script - i.e. a text-based task switcher.  Ideally, I'd love to have FARR show open windows first in the list of hits, so I could run the program if it wasn't open.

For example, if I have Outlook open, and type "out" into FARR, it would show the open window as the #1 choice, followed by the shortcuts, etc. it's found.  Or if I had Outlook open, as well as an explorer window for a folder named "Lookout" (which is what Outlook should've been named, imo, with 3 exclamation marks after it...) FARR would show the open Outlook and Lookout windows first, followed by the shortcuts, etc.

This would let FARR function as a very fast task switcher AND launcher, simultaneously...

Thanks for listening, and apologies offered if it can already do this (I did look in the help files and at the features list, but didn't find anything)...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #1 on: August 06, 2009, 10:07 AM »
Yes it can, if you use the FARRAltTab plugin from DC member vitalyb:
https://www.donation...ndex.php?topic=10988

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #2 on: August 06, 2009, 12:40 PM »
Almost perfect, thanks!  If only it could display the shortcuts to open an application if it's not already running...

But, still, much better than having to use a bunch of different utilities - thanks!

CatamountJack

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 56
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #3 on: August 06, 2009, 01:36 PM »
I think the first part of this is an interesting suggestion...   I use the FARRAltTab plug-in already, but it would be a great addition if FARR would seamlessly open the application if it isn't already open.

Maybe another way of putting it...   when the user types "out" to bring up Outlook, FARR searches all open windows to see if the program is already running first and, if so, brings it to the foreground - otherwise, it will open a new instance.  I could see that being useful all the time.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #4 on: August 06, 2009, 02:17 PM »
Yeah, I frequently have a dozen or more apps open, and I don't always remember if I've already opened an app, especially early in the day, so having a single way to bring it foremost, if it's running, or run it, if it's not, would be VERY nice... 

Another reason: some apps misbehave if you run multiple instances (or there's never a valid reason for running more than one instance), so I'd even like the ability to have FARR check for an instance of the app already running and give me the option of switching to it, rather than opening another...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #5 on: August 06, 2009, 02:21 PM »
that would actually be a fun plugin for someone to write -- a plugin that intercepts launch commands, and if it finds the exe already running, checks its lists of which programs should get second instances, and which programs should just be switched to.

if anyone feels like writing such a plugin, it is possible to do.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #6 on: August 26, 2009, 07:53 AM »
I'm just replying to this topic again because I'm wondering if others would find this useful.  Obviously, Mouser, nobody has replied to your statement that this would be "fun" to write, so does "fun" translate to "difficult" in your vocabulary, or is it likely that I'm just wanting something that nobody else does?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #7 on: August 26, 2009, 07:56 AM »
i think it's just a matter of waiting a little bit until a coder gets in the mood to do a plugin and then stumbles on this.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #8 on: August 26, 2009, 05:12 PM »
Could FARRAltTab be modified that it displays open windows AND normal FARR search results at the same time? I figure that it would be enough to provide the solution to mchalkley's original post.

On the more general note, is it possible to combine the results of two or more plugins and/or aliases? For example, one plugin displays open windows, the other displays firefox tabs, and at the bottom is  an alias with common apps.
It is impossible to make anything foolproof because fools are so ingenious.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #9 on: August 26, 2009, 09:40 PM »
I posted a message on the Executor forum asking whether it has the ability to switch to an open app instead of launching a second instance, and I got a response that you just check a box "Only one instance running in More keyword options of your keyword".  So it seems it has this capability natively, but I'll have to test it to see if it works properly.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #10 on: August 28, 2009, 09:23 AM »
Oh well, it was worth a try, but Executor's "switch if open" feature fails often enough that it's not really useful.  It seems to be close, in the sense that it never opens a second instance if you've checked that option for that keyword (alias), but it usually fails to switch to that app, which I found strange, since it seems that the most difficult part is the part that works.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #11 on: August 28, 2009, 09:29 AM »
fret not.
this is really going to be something that a plugin writer will be able to do for FARR, and enjoy coding.  it will be fun to make the first plugin that intercepts launch commands and takes them over, and it will be easy to make it so users can specify programs that should or should not be allowed to run multiple copies.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #12 on: August 28, 2009, 01:47 PM »
I've modified the FARRAltTAb plugin (to be exact - I just took the part where open windows are enumerated) and intercepted the Trigger command, that was the easy part. The logic of switching to open windows is already there from the FarrAltTab plugin, and if a window is not open, just let the execution proceed as normal.
 
I am not sure what to use as comparison for determining if a window is open or not. Window caption seems a bit too unreliable (although i'd have to test that, maybe it will be reliable enough). The other thing that came to mind was to check the exe file, but the path i get from FARR is the shortcut (.lnk file), and not the exe.

It is impossible to make anything foolproof because fools are so ingenious.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #13 on: August 28, 2009, 01:55 PM »
i can add a function to farr that your plugin can call which will resolve a shortcut and return the exe name.
in fact i think i already did, let me look it up.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #14 on: August 28, 2009, 01:56 PM »
yep, it's already there.

call
FARR.get_strvalue("resolvelnk:thepathtothelnkfile")
and farr will return the path to the exe

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #15 on: August 28, 2009, 03:02 PM »
I think Window Caption is where some other program's attempts to do this fall flat.  Right now, for example, my Firefox Window caption is "Can FARR be used to switch between open windows? - DonationCoder.com - Vimperator", which doesn't exactly provide too much of an indication that it's Firefox.  One problem, though, is that programs can have multiple windows - Outlook is a good example - so how do you pick which one?  It would be handy to be able to set up, along with the program list, a search string in the Windows caption to use to pick which window to make active.  That way, even if there are several Outlook messages open, as well as a Calendar window and an Inbox window, you could switch to the "Inbox" window.  This would also come in handy for activating "Documents" vs. "Downloads" Windows Explorer windows...

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #16 on: August 28, 2009, 03:50 PM »
yep, it's already there.

call
FARR.get_strvalue("resolvelnk:thepathtothelnkfile")
and farr will return the path to the exe
I had to modify vitalyb c# SDK a bit for this to work though. But any excuse for digging into c++ is good enough :)
It is impossible to make anything foolproof because fools are so ingenious.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #17 on: August 28, 2009, 04:16 PM »
Anyway, this seems to work on occasion, I tested it for the entire duration of 15 seconds, and about two or tree test cases :)

So let us think about options a bit:
- there should be a list of apps that should have only one instance
- or a list of apps to let have multiple instances
- some options about comparing (using path and caption or anything) that could help determining what instance to switch to (if more are running)
It is impossible to make anything foolproof because fools are so ingenious.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #18 on: August 28, 2009, 04:24 PM »
Executor's approach, though flawed in its execution, is very neat in its UI implementation:  there's a simple check box "Don't allow multiple instances", associated with the alias.  But that would require a change to FARR itself, I guess...

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #19 on: August 28, 2009, 04:26 PM »
do you really need to worry about captions? i think simply comparing full lowercased path names would be sufficient.

if you want to give users the MOST flexibility i think the options would look something like this:

By default: Launch multiple instances | Switch to running application if found

List of programs to always allow multiple instances:
[SIMPLE TEXT BOX, EACH PATH ON ITS OWN LINE]

List of progams to always switch to if found running:
[SIMPLE TEXT BOX, EACH PATH ON ITS OWN LINE]

-----

even this might be overkill, and one could assume that people who install this will almost always want to switch to running process, so just do that by default and have a list of paths of programs to allow multiple instances.

-----

you might also allow substring matching against paths, so i could specify
firefox.exe
in my list of programs to install multiple copies.

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #20 on: August 28, 2009, 04:41 PM »
List of progams to always switch to if found running:
[SIMPLE TEXT BOX, EACH PATH ON ITS OWN LINE]

In fact, my original idea was just this. Compare executable files and that's about it. User must specify a list of single instance apps.
It is impossible to make anything foolproof because fools are so ingenious.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #21 on: August 28, 2009, 04:44 PM »
I'm certainly in favor of the simplest approach that gets the job done.  So what would happen if there are multiple windows open, as with the examples I gave earlier?

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #22 on: August 28, 2009, 05:03 PM »
I'm certainly in favor of the simplest approach that gets the job done.  So what would happen if there are multiple windows open, as with the examples I gave earlier?
Windows explorer automatically activates a window if there's a same folder already open, so that is of no concern.
For now the plugin will activate the first window it finds that has the same path to the executable as the executed file. Outlook is a special case as it runs all of it's windows (main program, new message, etc) as the same process. Unless there are multiple outlook instances running.

I am thinking about maybe adding an option for a "preferred keyword" in the window title. So, first the plugin searches by executable file name, then if it finds more that one result, checks the resulting widows captions for preferred keywords. If no keywords are matched or multiple windows has the same keyword the first result is launched (as there is no way to distinguish windows further)
It is impossible to make anything foolproof because fools are so ingenious.

alias

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 71
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #23 on: August 28, 2009, 05:27 PM »
Awesome!  I'm really looking forward to getting rid of a couple other programs!

skajfes

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 267
    • View Profile
    • Donate to Member
Re: Can FARR be used to switch between open windows?
« Reply #24 on: August 28, 2009, 06:28 PM »
Well I must inform you that this plugin is coming along nicely. There could be a release in a couple of days if i get some more time. This is already cutting into my beauty sleep :D
It is impossible to make anything foolproof because fools are so ingenious.