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 08, 2016, 08:28:52 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: #filecontents FILEPATH -- how does it work?  (Read 3504 times)

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
#filecontents FILEPATH -- how does it work?
« on: March 02, 2009, 05:14:20 PM »
the new FARR 2.48.01 has added this:

#filecontents FILEPATH (can use %ALIASDIR%), to have the contents of the file dumped into the alias results when searching.

My first though that the FILEPATH should point to a textfile (e.g. C:\test\test.txt ) that includes paths to other files. Each such included path is then listed as a result in FARR when the alias runs. But that did not work when I tested it. So what exactly does it do?  :tellme: An example of an exported alias using this would be useful here.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 516
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #1 on: March 03, 2009, 01:38:53 AM »
hi Nod5,

i'll post a short tutorial about this feature when i have some time.

however just try to add that in front of your #filecontents command :

anything will do | #filecontents FILEPATH...

it seems that the "|" is needed to make it work  :huh:

cheers, Nitrix

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #2 on: March 03, 2009, 03:42:47 AM »
Aha, ok now I got it working.
Example: 1000>>>aoao>->test | #filecontents C:\test\a.txt
(and in a.txt put a filepath as a string )

It does not seem to work in companion with other alias specials:
1000>>>photo>->photo $$1 | dosearch +photo_modifier $$1 #filecontents C:\test\a.txt>+>^photo (.*)
Maybe it isn't supposed to work in such cases. But it would be cool if it did. I.e. if we got the results from the file at top and below it any and all matches from the search.

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 516
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #3 on: March 03, 2009, 08:37:09 AM »
as i understant it, the idea of the #filecontents command is to "only" externalize the list of results you put inside the result box within a alias edit dialog to an external file
so that you can edit your alias or share it much more easily

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #4 on: March 03, 2009, 10:06:19 AM »
huh?  :huh:

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 516
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #5 on: March 03, 2009, 10:38:17 AM »
sorry if i'm not clear enough ;)

take a look at my tiny tutorial to see what i mean :
http://www.donationcoder.com/forum/index.php?topic=17270.0

Nod5

  • Supporting Member
  • Joined in 2006
  • **
  • Posts: 858
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #6 on: March 03, 2009, 03:33:18 PM »
Ok, got it now. Then it can't do what I was most hoping for. That is combine the results from the .txt (placed first in the results) AND the results from a FARR search (placed last).

I can see the use of it for other purposes though. But I'm not sure how it makes alias sharing easier... Before, you only needed to do an export and the copy+paste that. With #filecontents you both need to export and copy+paste AND copy the external .txt file.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #7 on: March 03, 2009, 03:46:42 PM »
Quote
That is combine the results from the .txt (placed first in the results) AND the results from a FARR search (placed last).


someone could make an fsubscript plugin to do this very easily i think.

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,845
    • View Profile
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #8 on: March 04, 2009, 01:15:34 AM »
I'm not sure I'm following Nod5's idea very clearly.

Reflecting on the following bits from the perspective of a plugin implementation:

Quote
a textfile (e.g. C:\test\test.txt ) that includes paths to other files. Each such included path is then listed as a result in FARR when the alias runs.

Quote
That is combine the results from the .txt (placed first in the results) AND the results from a FARR search (placed last).

The first bit raises the question of how the plugin finds which file to work w/:

  • via a special file extension?
  • via a user variable setting made by the user?
  • via a specific directory (or multiple directories) to look in?
  • or some other means...

The second bit has me wondering about how to ensure that all items from the file (.txt or something else appropriate) appear before all other results.  Very large score inflation?

Any thoughts?

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,412
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: #filecontents FILEPATH -- how does it work?
« Reply #9 on: March 04, 2009, 05:56:35 AM »
ewe,
to keep things simple you might simply:
1) let user specify a filename in the user variables where the result alias will be found
2) let user specify a score to be applied to all of the items, but then return the results such that farr can add its score to that score.

actually now that i type this out, perhaps this would be best implemented in core FARR functionality..

perhaps what i should do is make it so that if you type +ALIASNAME it will *add* the alias contents (including obeying a #filecontents) into the current search results (with their configured score), but *not* to the exclusion of other searching.  i think that would accomplish what is desired.
« Last Edit: March 04, 2009, 06:00:39 AM by mouser »