topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Friday March 29, 2024, 12:34 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

Author Topic: Change search folders with an alias / plugin?  (Read 5567 times)

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Change search folders with an alias / plugin?
« on: September 08, 2016, 03:16 AM »
Hallo,
is there a way to change the search folder configuration, for example by an alias or a plugin?

Thanks,
Kanaille

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #1 on: September 08, 2016, 04:21 AM »
you can have dynamic search folder using user variable like so :
%uservar.MyVars.var1%

you can use an alias to launch a script to change the user variables using FARR command-line parameters :

FindAndRunRobot.exe -launch "setuservar MyVars.var1=MyDynamicFolder"
FindAndRunRobot.exe -launch "recachedirpaths"

one pb though, there is a 300-characters limit bug, but i'm confident Mouser will smash it soon  :D

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #2 on: September 08, 2016, 08:47 AM »
@nitrix: Thanks for the tip, but it doesn't work properly. The user variable is updated correctly, but recaching the directory paths doesn't work. I have to go to the settings dialog and click ok, only then the search dirs are updated.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #3 on: September 08, 2016, 09:04 AM »
Does it work if you hide FARR, then open it again ? (without going into the dialog...) if yes...

maybe you could try
FindAndRunRobot.exe -hide
and
FindAndRunRobot.exe -search "sometext" or FindAndRunRobot.exe -show

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #4 on: September 08, 2016, 09:49 AM »
Ok it was my failure...when I typed in my alias and confirmed it with enter, FARR showed me the two commands and I quickly hit enter again, so that only the set variable was executed. When I type in the alias again and then choose the second command, it reloads the dirs properly.

Now the question is: how can I make it work so that I only have to type in the alias and both commands will be executed when I press enter?

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #5 on: September 08, 2016, 10:16 AM »
using ;;; ?

from the help file
You can now specify multiple programs to launch within one alias by separating them with ;;;

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #6 on: September 08, 2016, 10:19 AM »
Sorry, didn't mention this in my previous post: I tried it, but that didn't work.
Is there an alternative how I can execute two distinct commands from an alias at once?

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #7 on: September 08, 2016, 10:37 AM »
you can use one autohotkey script which execute multiple runs
RunWait, farr.exe ....
RunWait, farr.exe ....

Do you mind posting your alias ;)

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #8 on: September 08, 2016, 10:45 AM »
Thanks so much for your help and that you don't hesitate to ask  :up:

While I was copying the alias into the forum, I saw my mistake. I thought it should be like this:
d:\Portable\FARR\FindAndRunRobot.exe -launch "setuservar Common.NTGDir=e:\NTG;;;recachedirpaths"

The correct way, though, is to do it like this:
d:\Portable\FARR\FindAndRunRobot.exe -launch "setuservar Common.NTGDir=e:\NTG";;;d:\Portable\FARR\FindAndRunRobot.exe -launch "recachedirpaths"

Now it's working like a charm  :)

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #9 on: September 08, 2016, 10:51 AM »
Glad I could help  :D

don't hesitate to share your ideas, It seems you are doing pretty sophisticated stuff here ;)

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #10 on: September 08, 2016, 10:55 AM »
Ok, what I'm actually doing is the following:
I'm a software developer and we have several different branches which are in different directories. Sometimes I have to switch between the branches quite often, but most of the time I am working on a branch for several hours or days.

For this, I have added aliases that let me built project files with FARR. I only want to build from the branch that I'm currently working in - to make switching easy, I now have aliases that change the search folder to the branch I'm working on.

Really cool now, don't have to go into the options dialog all the time.

kanaille11

  • Participant
  • Joined in 2014
  • *
  • default avatar
  • Posts: 7
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #11 on: September 08, 2016, 10:57 AM »
Btw is there some way to log which commands get actually executed from an alias after user variables have been resolved?

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Change search folders with an alias / plugin?
« Reply #12 on: September 08, 2016, 11:20 AM »
Nice, pretty much the same for me, I'm a web developper, and use that to switch among 300 different customers... use it all day

Btw is there some way to log which commands get actually executed from an alias after user variables have been resolved?
I'm not sure i get your question... if you want to log when you switch from one project to another, you could do it yourself by adding a third command using ;;;scripttolog.ahk "switch to A"