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, 2:58 pm
  • 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

Author Topic: DONE: Farr's go away  (Read 17693 times)

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
DONE: Farr's go away
« on: March 16, 2006, 03:10 PM »
Since farr still doesn't have internal commands, i made this small script for myself, and decided to post it here.

Using ctrl+space to bring up farr can be a problem, for example, the selection in emacs won't work, since it's bound to that same key, and also, you can't select various items in explorer, by pressing ctrl+space.

I configure it like this: Add it to farr's directory of scripts.
Then, when i want to use ctrl+space, i press ctrl+space to bring up farr, and i type exit[enter], to execute this script.
The script closes farr, and keeps itself in the tray.
It creates a hotkey, so that when i press [windows key]+F, it runs farr, and exits.

It's just an easy way of being able to use ctrl+space, and still be able to call farr up real fast again, since farr is all about speed and productivity ;)

(.ahk file attached, .rar contains .ahk and .exe)

kfitting

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 593
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #1 on: March 16, 2006, 04:26 PM »
This does not make your script null and void, but what about alt-space and pause/break?  I have never used ctrl-space... also, I know mouser has a hotkey control in CHS, he could probably add it to FARR if you wanted more configurability.

But, at the end of the day, if your script does what you want, use it!

Kevin

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #2 on: March 16, 2006, 05:36 PM »
:)  kfitting that's not the issue.
I don't like to use pause (it's too far ;) ), and alt+space has a strange focus behaviour.
I do like to use ctrl+space, but sometimes, i just want to disable it, that's what this script is for ;)
I just execute "exit", and when i want to use farr again, i press ctrl+f :D

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #3 on: April 24, 2007, 12:15 AM »
jgpaiva, thanks for pointing out this thread for the request i made here. btw, for portability reasons, i've made some changes and i hope you don't mind. :) and i've also made another script that brings Farr to the front when using the mouse (i use this as a link in Launchbar Commander)..

Farr exit
; Original Script by jgpaiva from DonationCoder
; To close Farr, call this script inside Farr
; Useful when updating Farr, Win+F to open Farr
; Source: hxxp://www.donationcoder.com/forum/index.php?topic=2812.0
;
#singleinstance,force
#persistent
;Set path here
Farr_exe=%ProgramFiles%\FindAndRunRobot\FindAndRunRobot.exe

hotkey,#f,findandrun
Process, exist,findandrunrobot.exe
if errorlevel <> 0
  Process,close,findandrunrobot.exe
return

findandrun:
Run,%Farr_exe% -tray
ExitApp


Farr to the front
; This script is to bring up Farr window via mouse
; Useful when in 'click' mode.. ;-)
; Source: hxxp://www.donationcoder.com/forum/index.php?topic=2812.0

#SingleInstance, force
#NoTrayIcon
;Set path here
Farr_exe=%ProgramFiles%\FindAndRunRobot\FindAndRunRobot.exe

Process, Exist,FindAndRunRobot.exe
If ErrorLevel <> 0
  Send, {Pause}     ;'Pause' key is the default
Else
  {
  Run,%Farr_exe% -tray
  Sleep, 1000
  Send, {Pause}
  }
Return


tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #4 on: April 24, 2007, 05:45 AM »
Lanux.pngDONE: Farr's go away

just in case you didn't notice there Lanux, you're up at 999 posts -
if you havent posted since,
theres a thread somewhere for the 1,000th post insnt there?
Tom

tomos

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 11,959
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #5 on: April 24, 2007, 05:48 AM »
but what i really wanted to say  :)
was to ask -
how you use the second script -
i mean what do you do with mouse !?


ah, i see theres a link in there, I'll check that out

EDIT: link is for here  :D
Tom

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #6 on: April 24, 2007, 09:34 PM »
thanks tomos, i've already updated here.. :up:

as for the 2nd script, if you have AHK, copy & save the script then drag-n-drop the script onto LC (see pic) or drop on desktop to create a shortcut.. or you can compile into a EXE then use as a program.. :)

ws-farr-to-front-1.png

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #7 on: August 15, 2008, 01:03 AM »
reviving an old thread. recently i had to experiment with some of the Farr's commands which required me to exit and restart Farr. after doing this for a while, i just hit my head and modified the Farr-exit script above to restart Farr instead. hope someone finds this helpful.

; Original Script by jgpaiva from DonationCoder
; Restarts Farr with a delay of 15 seconds
;
#Persistent
#SingleInstance force
#NoEnv
#NoTrayIcon
Farr_exe=%ProgramFiles%\FindAndRunRobot\FindAndRunRobot.exe

Process, Exist, FindAndRunRobot.exe
If ErrorLevel <> 0
  {
  Process, Close, FindAndRunRobot.exe
  ToolTip, Farr is being closed and will be restarted in 15 seconds.
  Sleep, 15000  ;modify the delay here 1000 = 1 sec.
  Run,%Farr_exe% -tray
  }
ToolTip ;remove ToolTip
ExitApp
Return


CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #8 on: October 05, 2008, 09:08 AM »
Can this be used after FARR has already crashed?
« Last Edit: October 05, 2008, 09:22 AM by CleverCat »

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #9 on: October 05, 2008, 10:55 AM »
CleverCat: you mean use this so that farr will come back when it crashes?

Currently, Exit.ahk only launches farr and then goes away until you start it again, so the answer would be no..

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #10 on: October 06, 2008, 08:20 AM »
Okay...  :)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #11 on: October 07, 2008, 12:00 AM »
Can this be used after FARR has already crashed?

you can modify my script so that it launches Farr whenever Farr's process is not existent.

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #12 on: October 07, 2008, 01:57 AM »
http://img117.exs.cx/img117/5279/m2vhelp.gif
DONE: Farr's go away


 ;)

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #13 on: October 08, 2008, 04:25 AM »
this is a quickly-done script so please let me know if anything goes astray. ;)

usage: not much to do but if you've installed Farr in a custom location then edit the script accordingly. use Win+q to exit the script

; Original Script by jgpaiva from DonationCoder
; Keep Farr running
; If nonexistent, starts Farr after a delay of 10 seconds
; Source: https://www.donationcoder.com/forum/index.php?topic=2812.msg132848#msg132848
;
#Persistent
#SingleInstance force
#NoEnv
;#NoTrayIcon
;change the path if necessary
Farr_exe=%ProgramFiles%\FindAndRunRobot\FindAndRunRobot.exe

SetTimer, WatchFarr, 1500  ;increase or decrease timer accordingly
Return

WatchFarr:
Process, Exist, FindAndRunRobot.exe
If ErrorLevel <> 0
  Return
Else
  {
  ToolTip, Farr is not detected and will be started in 10 seconds.
  Sleep, 10000  ;modify the delay here 1000 = 1 sec.
  Run,%Farr_exe% -tray
  }
ToolTip ;remove ToolTip
Return

;Win+q exits...
#q::ExitApp


CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #14 on: October 08, 2008, 07:15 AM »
 :Thmbsup: Brilliant, thanks lanux - works well!


lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #15 on: October 08, 2008, 09:07 AM »
@CleverCat: you're welcome. glad to be of help. :)

CleverCat

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 1,164
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #16 on: October 09, 2008, 02:46 AM »
 :D

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Re: DONE: Farr's go away
« Reply #17 on: November 08, 2008, 02:08 AM »
Inspired by the work in this thread [1], I put together an AHK script to start or stop FARR depending on whether FARR is not or is already running [2] -- it asks for confirmation via dialog boxen to defend against accidental invocation.  Perhaps someone might find it useful at some point.

ToggleFARRMayBe function
ToggleFARRMayBe()
{
  FarrExe = FindAndRunRobot.exe
  ; XXX: change appropriately - would be nice to read in path values from elsewhere...perhaps some day
  FarrFullPath = L:\Plus\FindAndRunRobot\%FarrExe%
  Process, Exist, %FarrExe%
  if (ErrorLevel <> 0) ; yes FARR
  {
    ; Yes/No + Question (4 + 32)
    MsgBox,36,,FARR seems to be running -- leave alone?
    IfMsgBox No
      Process, Close, %FarrExe%   
  }
  else ; no FARR
  {
    ; Yes/No + Question (4 + 32)
    MsgBox,36,,FARR doesn't seem to be running -- start?
    IfMsgBox Yes
      Run, %FarrFullPath%   
  }
  Return
}


For invocation, I have something like the following:

; toggle farr...may be
^!q::ToggleFARRMayBe()


[1] Thanks to lanux128 for pointing this thread out :)
[2] Actually, it lives in the AHK script I use for custom hotkeys.