ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Find And Run Robot

Pass a folder as a parameter

(1/2) > >>

charlesroper:
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:
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:


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:
Perfect! That is so, so sweet.  :-*

Cheers!
Charles

charlesroper:
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:
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.

Navigation

[0] Message Index

[#] Next page

Go to full version