topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Saturday December 14, 2024, 2:28 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: FARR v2 Tricks and Tips Clinic  (Read 17717 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
FARR v2 Tricks and Tips Clinic
« on: June 06, 2007, 10:41 AM »
I thought i'd start a little thread for FARR tricks+tips on some of the more unusual stuff in FARR v2.

I'll start with a trick that demonstrates the "dosearch" special alias action.  Although described in the help file its not obvious how you might use this special action.  Here's one way.

You know that FARR2 can do direct browsing of folders, etc.
So you could type "C:\Program Files\Microsoft\..." etc.

Here's an alias that will let you type "pf\" instead of "C:\Program Files\" as a shorthand:

1000>>>pf alias search>->dosearch C:\Program Files\$$1>+>^pf\\(.*)$

just select that code and go to your alias file and choose IMPORT menu.

basically it just says that on matching regular expression "^pf\\(.*)$"
treat that as if user typed "C:\Program Files\$$1"

so the dosearch alias action is a way of letting the user type one thing, and making the program think they typed another.

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #1 on: June 08, 2007, 05:20 AM »
I thought i'd start a little thread for FARR tricks+tips on some of the more unusual stuff in FARR v2.

I'll start with a trick that demonstrates the "dosearch" special alias action.  Although described in the help file its not obvious how you might use this special action.  Here's one way.

You know that FARR2 can do direct browsing of folders, etc.
So you could type "C:\Program Files\Microsoft\..." etc.

Here's an alias that will let you type "pf\" instead of "C:\Program Files\" as a shorthand:

1000>>>pf alias search>->dosearch C:\Program Files\$$1>+>^pf\\(.*)$

just select that code and go to your alias file and choose IMPORT menu.

basically it just says that on matching regular expression "^pf\\(.*)$"
treat that as if user typed "C:\Program Files\$$1"

so the dosearch alias action is a way of letting the user type one thing, and making the program think they typed another.

I can sortof follow that, but could you back up a bit and recommend a simple reference to regexes as used in Farr for people who are not used to working with them? How does the line of code relate to what you would put in the text boxes if you were defining the aliases yourself?

I'd like to see aliases working more like folders: if you select an alias that takes parameters it presents in the results window a list of those parameters that you have already used. Further typing filters the list as if it were a file list, and you can select-and-launch, or launch with the parameter you have just typed in.
If you don't see how it can fail -
you haven't understood it properly.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #2 on: June 08, 2007, 06:35 AM »
How does the line of code relate to what you would put in the text boxes if you were defining the aliases yourself?
here's the screenshot:
Screenshot - 6_8_2007 , 6_32_31 AM.png


could you back up a bit and recommend a simple reference to regexes as used in Farr for people who are not used to working with them?
http://www.regular-expressions.info/


cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #3 on: June 08, 2007, 02:12 PM »
this should be similar to having an folder alias 'pf' and then typing '+pf \\ microsoft'
right?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #4 on: June 08, 2007, 02:22 PM »
no, whats special about using the dosearch action is that it is live as you type.  try it and see.

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #5 on: June 08, 2007, 03:51 PM »
How does the line of code relate to what you would put in the text boxes if you were defining the aliases yourself?
here's the screenshot:

Thanks, that clears things up a bit. I've just checked the "display preformatted aliases for copying" function on "Import and Export"

One entry per line
>>> starts group alias name
>-> starts Result(s)
>n> starts new line in results
>+> starts regular expression pattern

What do you use for Result Filter or Hotkey shold you need to specify them?



could you back up a bit and recommend a simple reference to regexes as used in Farr for people who are not used to working with them?
http://www.regular-expressions.info/

Thanks. Very useful!  :Thmbsup:
If you don't see how it can fail -
you haven't understood it properly.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #6 on: June 08, 2007, 06:26 PM »
im going to change the import and export format to use xml like the new alias files use, so this import and export format may not be very important to remember, but you can see the hotkey and result filter format simply by "exporting" an alias with those things.

basically its:

SCORE>>>NAME>->RESULTS>+>REGULAREXPRESSION>/>HOTKEYNUMBER>#>REGEXRESULTFILTER

cthorpe

  • Discount Coordinator
  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 738
  • c++thorpe
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #7 on: June 09, 2007, 12:37 AM »
I have two program files locations.  One is at C:\Program Files and the other is at D:\Program Files.  Would it be possible to have the pf alias search both locations?

Carl

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #8 on: June 09, 2007, 12:41 AM »
to "search" in those places, you could add both directories to the search directories tab, and add the "pf" modifier to both.

then if you wanted to search in both places for a file you would do:
"+pf filename"

the dosearch alias example above is for directory BROWSING, not for normal searching (so no you cant combine both folders since its really browsing the directories).

JennyB

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 212
  • Test all things - hold fast to what is good
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #9 on: June 09, 2007, 01:30 AM »
im going to change the import and export format to use xml like the new alias files use, so this import and export format may not be very important to remember, but you can see the hotkey and result filter format simply by "exporting" an alias with those things.

basically its:

SCORE>>>NAME>->RESULTS>+>REGULAREXPRESSION>/>HOTKEYNUMBER>#>REGEXRESULTFILTER

<slaps head>
Thanks mouser, I've been out of the testing loop for a while, revising for final BSc exams. The download link seems to have changed - can you send me the new one?

If you don't see how it can fail -
you haven't understood it properly.

cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #10 on: June 09, 2007, 09:01 AM »
Mouser, I can not understand this behavior ...
I have created 2 search templates here...

lab --> ^lab\\(.*)$ --> c:\lab\$$1
pf --> ^pf\\(.*)$ --> c:\program files\$$1

now, typing lab\exe shows all executable files in c:\lab but NOT anything beyond that level. However, typing pf\exe shows executables in main folder and ALL subdirs recursively.

To show all exec's recursively in lab I have to type 'lab\*\exe'.

Why is it different?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #11 on: June 09, 2007, 09:14 AM »
However, typing pf\exe shows executables in main folder and ALL subdirs recursively
are you sure this is true -- or is it the case that there are no exe matching entries in the main folder? my memory is that it works like this: IF matching files are found in the exact directory you specify, then its not going to go into subfolders.  only when you tell it to show you exe matching files in some explicit directory and it doesnt find any will it then try to help you out by searching deeper.

you could of course add the \*\ into your aliases to always look as deep as it can.

cnewtonne

  • Honorary Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 117
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #12 on: June 09, 2007, 09:23 AM »
This makes sense because it did this recursive find on 2 of my dirs out of 5. When I checked them, none contained the exe I told it to find so it went ahead and continued downwards in the tree. I could not understand why is it behaving differently across dirs. For now, I wanted it to be a greedy as possible by adding \*\ and it works consistently now.

One last question, though, adding '\*\' to my search template now will make these 2 search strings return same results...

lab\exe
+lab exe +sall

The template simply and implicitly did the '+sall' for me. Right?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #13 on: June 09, 2007, 09:41 AM »
there is a difference. +sall should show all, without it, it will still show a lot due to the new ability to specify a larger # of results when directory browsing (see options). i think.

urlwolf

  • Charter Member
  • Joined in 2006
  • ***
  • Posts: 1,837
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #14 on: June 29, 2007, 05:26 AM »
selecting the create a new alias file option makes FARR dies with an access violation error. :( v. 2.00.116 here.

rjbull

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 3,205
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #15 on: June 29, 2007, 05:53 AM »
selecting the create a new alias file option makes FARR dies with an access violation error. :( v. 2.00.116 here.

Same here with v.2.00.108 on Windows XP [Version 5.1.2600]:

---------------------------
Find and Run Robot
---------------------------
Access violation at address 00571080 in module 'FindAndRunRobot.exe'. Read of address 40508902.
---------------------------


edbro

  • Charter Member
  • Joined in 2006
  • ***
  • default avatar
  • Posts: 426
    • View Profile
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #16 on: June 30, 2007, 02:03 PM »
Not really a FAR trick but just a tip. For OneNote users (and Evernote), you can create hyperlinks to individual pages. For some of my most used notes I use those hyperlinks to create shortcuts which I place in a folder searched by FAR. Now I can go directly to an individual note in OneNote.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #17 on: June 30, 2007, 02:10 PM »
The new alias file crash has been fixed in latest version, thanks for the bugreports.

hamradio

  • Charter Honorary Member
  • Joined in 2006
  • ***
  • Posts: 884
  • Amateur Radio Guy
    • View Profile
    • HamRadioUSA.net
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #18 on: June 30, 2007, 09:47 PM »
You can use restartsearch in conjunction with another alias to have recursive aliases...

Ex. You have two aliases named this and that.

So you create another group alias (we will say test for this example) and name it what you want...then you add the following for the results to show...

this | restartsearch this
that | restartsearch that

Now when you type test it will allow you to pick from those 2 aliases.

Enjoy!  :)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,914
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: FARR v2 Tricks and Tips Clinic
« Reply #19 on: June 30, 2007, 09:49 PM »
It's a little hard to see how this would be useful until you see it in action in ham's plugin.. basically it let's you simulate hierarchical menus of aliases.