Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • December 04, 2016, 08:25:21 AM
  • Proudly celebrating 10 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: Pass a folder as a parameter  (Read 2391 times)

charlesroper

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Pass a folder as a parameter
« on: October 07, 2009, 11:41:55 AM »
Hi

I'm new to FARR and so apologies if the answer to this question is common knowledge:

I have several apps that take a folder as a parameter; is it possible to setup an alias for an application that takes a folder as a parameter? Ideally, I would like to be able to browse for the folder using FARR's inbuilt browser or search for it by typing a few characters.

Possible?

Many thanks,
Charles

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Pass a folder as a parameter
« Reply #1 on: October 07, 2009, 12:20:10 PM »
you can do it using one of FARR's least known tricks  :Thmbsup:

create an alias that has no regular expression, BUT uses $$1 in a result launch like so:
Screenshot - 10_7_2009 , 12_12_44 PM.png

and now you can execute that launch on any result you search for or directory you browse from within farr by typing +ALIASNAME at start (or end) of the search.

so in the example above you could type and then hit enter:

+br c:\windows\sytem32
or
c:\windows\sytem32 +br

to launch the alias on that searched for directory.

The trick works because FARR sees that you put a + in front of the alias name and there is a $$1 in the result.



TIP 1 : You can even specify multiple results in the alias.  Then after you search for something (file or folder) and hit enter, you will get a menu of your results to run on the selected file/folder.

TIP 2: Remember, you have to use the +ALIASNAME form -- if you just type the ALIASNAME without a + then farr will tread it like a normal alias and won't let you continue searching for a file/folder.

TIP 3: If you don't like hitting the + you can always create a second helper alias that matches a regular expression and emulates you typing the +ALIASNAME, using the dosearch function.

TIP 4: Discover tons of FARR tips and tricks from this screencast series: http://donationcoder.com/3ds/

charlesroper

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Pass a folder as a parameter
« Reply #2 on: October 08, 2009, 04:33:08 AM »
Perfect! That is so, so sweet.  :-*

Cheers!
Charles

charlesroper

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Pass a folder as a parameter
« Reply #3 on: October 08, 2009, 07:32:21 AM »
One more quick follow-up question to this: seeing as I am passing a folder as a parameter, how do I restrict my search results to folders only?

Cheers,
Charles

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,406
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Pass a folder as a parameter
« Reply #4 on: October 08, 2009, 07:43:59 AM »
add +\ to your search.
and the desire to do that makes it now all the more useful to create a second alias that avoids you having to type that.

so for example you could create a second alias that matches on ^bs (.*)$
with the result:
dosearch +br $$1 +\

now, when combined with your first alias, you can type
bs some terms here

to have it search only folders matching the terms you specify, and when you hit enter, launch your command on them.


charlesroper

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 5
    • View Profile
    • Donate to Member
Re: Pass a folder as a parameter
« Reply #5 on: October 08, 2009, 01:30:35 PM »
Awesome, thanks!