The following AHK_L script should display FARR's main window and then move it close to the pointer. I use this when there's something near the pointer I want to drop in FARR's main window (reduce dragging distance and hence risk of mis-drop).
May want to tweak the full path to FARR's exe (see FarrFullPath in code) and/or the hotkey (see KeySequence in code).
Tested on XP SP3 and 7 Pro SP1.
Updated: as per Nod5's suggestion to use A_ProgramFiles
May want to tweak the full path to FARR's exe (see FarrFullPath in code) and/or the hotkey (see KeySequence in code).
Tested on XP SP3 and 7 Pro SP1.
promotion
The script may end up as part of Nea.
Code: (autohotkey)
#SingleInstance
#Persistent
; change this as desired
KeySequence := "^+p"
; XXX: may need to change this
FarrFullPath := A_ProgramFiles . "\FindAndRunRobot\FindAndRunRobot.exe"
CoordMode, Mouse, Screen
ShowFARRAtPointer()
{
global FarrFullPath
SplitPath, FarrFullPath, FarrExe
Process, Exist, % FarrExe
If (ErrorLevel != 0) ; yes FARR
{
MouseGetPos, X, Y
Run, % FarrFullPath . " -show"
WinWaitActive, % "Find and Run Robot 2 ahk_class TMainForm"
If (ErrorLevel == 1)
{
OutputDebug, % "WinWaitActive timed out waiting for FARR"
Return
}
; XXX: will this work for multi-display set-ups?
WinMove, % "Find and Run Robot 2 ahk_class TMainForm", , % X, % Y
}
Else ; no FARR
{
; OK/Cancel - esc dismisses dialog
MsgBox, 1, % "Did Not Find Running FARR"
, % "FARR doesn't seem to be running.`n`nOk to start FARR?"
IfMsgBox, OK
{
Run, % FarrFullPath
}
}
Return
}
Hotkey, % KeySequence, DoShowFARRAtPointer
Return
DoShowFARRAtPointer:
{
ShowFARRAtPointer()
Return
}Updated: as per Nod5's suggestion to use A_ProgramFiles










