ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE. Software > Find And Run Robot

last window id

(1/9) > >>

Is it possible to get the hwnd of the last focused window in a plugin or alias? I know farr tracks it for other features, but it would be really helpful to be able to use it for other things. If it's not currently possible, consider this a feature request.

Hi cardboard:

%LASTHWND% - integer value referring to the last window handle that had focus before FARR was triggered.

FARR actually uses such information when doing it's pasting functions, so that it can paste into the program that had focus when it was triggered.

Happy to answer more questions if you have an idea you are trying to implement.

Basically I'm trying to implement a FARR version of the AHK Favorite Folders script (which I was the original author of). I'm now trying to make an alias action keyword that would launch a ahk script with the last hwnd and the selected result. This script would navigate the last focused window appropriately. Unfortunately I can't get the keyword to work.

I defined the alias like this: 1000>>>+test>#>C:\Command\Shell\AutoHotkey\Scripts\wintest.ahk %LASTHWND% "$$1"
And tried to use it like this: +test C:\command
I expected it to launch my script with C:\command as the second arg, but it just does the usual action.
Am I missing something here?

i need to understand a little bit more about what you want to do.

IF what you want to do is type something like:
cardboardtest WHATEVERIWANT

and have it launch
C:\Command\Shell\AutoHotkey\Scripts\wintest.ahk %LASTHWND% "WHATEVERIWANT"

then what you want is just to define an alias and specify the regular expression
^cardboardtest (.*)$

that will capture the $$1 as you intend.

however if what you want is to let user search for a file the normal way, and use that found file as the $$1 then it's a little bit more complicated and you are on the right path.  i think the problem is you dont put the + in your alias name when you define the alias. just use test or cardboardtest whatever.

the + is the way the user tells FARR when they are typing that they want to use the alias to launch the result.

Awesome, leaving off the plus did what I intended, though it seems that may not have been what I wanted  ;)
I'll have to experiment a bit to find the nicest method.
Thanks for your help!


[0] Message Index

[#] Next page

Go to full version