topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Wednesday April 17, 2024, 8:32 pm
  • 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: [tiny-tutorial] how to use #filecontents ? (new Major FARR feature)  (Read 8800 times)

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
There is a brand new (and major IMHO) feature in the last FARR release... that is : #filecontents

it allows you to "externalize" aliases... here is how :

1) let's take one of my favorite alias the "g" search, i use it to search google in various ways, yahoo, look up words, etc.
here it is in action :
farr.png[tiny-tutorial] how to use #filecontents ? (new Major FARR feature)

2) here is the alias in the options dialog:
options_before.png[tiny-tutorial] how to use #filecontents ? (new Major FARR feature)

3) instead of putting the results right inside the alias edit dialog use the new #filecontents command :
f | #filecontents C:\_Garbha\Program Files\_FarrAliases\g.txt
Please note that the part before the actual #filecontents is needed, otherwise this does not work (the "|" seems to be needed at present)
options_after.png[tiny-tutorial] how to use #filecontents ? (new Major FARR feature)

where g.txt now contain the result list that was previously in alias edit dialog
file_to_be_dumped.png[tiny-tutorial] how to use #filecontents ? (new Major FARR feature)

done !


so why is it such a great feature ?
i will give you three reasons :

1) it is as fast as an internal alias

2) it is much easier to edit an "externalized" alias
you can use your favorite editor... full screen... on a secondary monitor...
and see the results in FARR in REAL-TIME
believe me it is a real improvement

3) you can share your aliases with much more ease...
once you've set up the alias... you basically have to copy and paste a file

even better, if you use Windows Live Sync/Foldershare (or dropbox ?) you can share modifications you've made in real-time with no intervention whatsoever
(once you've set the folder containing the files to be dumped to be synchronized...)
how is that ?  ;)

Once again mouser, you made my year with this new feature...
keep up the good work

« Last Edit: March 03, 2009, 02:21 AM by nitrix-ud »

lanux128

  • Global Moderator
  • Joined in 2005
  • *****
  • Posts: 6,277
    • View Profile
    • Donate to Member
a good tutorial on the feature. i picked up a few pointers as well.. :Thmbsup:

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Thanks for the tutorial  ;D

I wonder if there is anything interesting that could be done by:

  • Set up an alias using #filecontents pointing to some file (call it A)
  • Use a plugin to generate the content of a temporary file -- eventually to replace A
  • When the temporary file construction is complete, move / copy it over A

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
@ewemoa

that would be indeed very interesting

and what about the following ?
 
  • Set up an alias using #filecontents pointing to some file (call it A)
  • Use a plugin to execute a file (exe, lnk, ahk, whatever...) which create a temporary file (that way people can create the file using autohotkey or any other software)
  • When the temporary file construction is complete, move / copy it over A

or this one :


even better (mouser's idea) what if the plugin could add suffix and prefix when executing the result
let's say the mycontactlist.php returns :
John Smith
Bob Brown
Steve McEnroe
etc.

let's say the suffix would be :
http://http://www.my...com/search.php?name=

then you could create an alias to query a contact list online and then open the resulting page in your browser... awesome

suffix and prefix support would be really awesome

could be to search php functions...
juste have a list with all php functions
then have the following suffix :
http://www.php.net/

 :D

hope someone will do it some day !!!




ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
Considering the plugin ideas, the timing of the triggering of the mechanism for generating the content of the #filecontents file is unclear for me -- doing it each time the alias is about to be used seems potentially problematic.  Depending on the case, a periodic execution might be sufficient but I'm hazy on this.

I'm not so clear on the benefits of having a network version of #filecontents if one of the earlier plugin ideas of using an external script or some code are implemented.  Similarly for the suffix and prefix support -- these also seem doable via one of the earlier plugin ideas.

On a side note, have you tried:

  https://www.donation...ex.php?topic=15904.0

for searching php functions? ;)

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
On a side note, have you tried:
for searching php functions?

nope, but i should...  :Thmbsup:
however, the idea behind my php functions search is to search among existing functions... not just search php.net site : www.php.net/%keyword%

ewemoa

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 2,922
    • View Profile
    • Donate to Member
To continue the OT bit a bit...

Well, FWIW, the second result for me when I type:

sg php

is:

PHP Function Lookup - $2

Does that do it for you?