topbanner_forum
  *

avatar image

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

Login with username, password and session length
  • Thursday March 28, 2024, 3:54 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: Looking for a little help with arguments.  (Read 9525 times)

Ghostly

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Looking for a little help with arguments.
« on: March 27, 2008, 02:32 AM »
I use wordweb as my dictionary software. I like it because I can do offline searches on definitions and that makes my life alot easier. Anyway, i'm trying to make a alias that will launch wordweb with a predefined word in the search box, but i'm not sure what arguments to use for this, considering that I don't know anything about arguments to begin with and there is little help within FARR's help files. If anyone could help me with this problem it would be most appreciated.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #1 on: March 27, 2008, 03:24 AM »
Hi Ghostly.

Using wordweb with FARR:
https://www.donation...dex.php?topic=7989.0

NOTE:
I believe that wordweb is already configured in a built-in FARR v2 alias called "define", so if you type "define ghost" youll see wordweb at the end of the list.  But you can go inspect the define alias in the Linguistics alias group in options to see how it's done.
« Last Edit: March 27, 2008, 03:26 AM by mouser »

Ghostly

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #2 on: March 27, 2008, 04:17 AM »
Thanks for your help Mouser. The code works perfectly. Also, I originally looked in the "define" alias to see if wordweb was in there. For some reason I only saw the wordweb website addition and totally missed the native wordweb command. When you mentioned it I took a second look and found it at the end there. *feels stupid* Anyway, thanks for the speedy reply. I've tested alot of launchers out there and non of them have been able to reach the levels of customization that FARR does. Keep up the good work.

JLeiderman

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #3 on: May 26, 2008, 01:32 PM »
I am new to FARR, after trying -- and dropping -- most of the competitors (Launchy, Slickrun, Keybreeze, etc.) and am really impressed thus far (FARR?).  I have a reasonable understanding of reg expressions, though I am still figuring out aliases. 

What mystifies me as a new user is why there is apparently no native, out-of-the-box handling of arguments.  For example, I am very happy to discover that entering k- in the box brings up k-meleon browser at the top of the search list, I hit tab, Enter, and launch the browser. 

However, if try to give it an argument in the box,

    C:\Program Files\K-Meleon\k-meleon.exe  www.google.com

on hitting return I get nothing.  It seems to me that launching a program this way with argument(s) would be the expected default (i.e. no alias) behavior, or, I guess, the behavior I would want.  Just as I can type in a dos console

    "C:\Program Files\K-Meleon\k-meleon.exe" www.google.com

and launch an instance of the browser with the URL. (Parens required -- but couldn't FARR even make them unnecessary?)

I won't be surprised if I am missing something simple.  Apologies in advance if this is a stupid question, and thanks for your hard work and really impressive coding.



PS Just now it occurs to me I can use

     run C:\Program Files\K-Meleon\k-meleon.exe www.google.com

which works nicely, but if I start by typing run k-.... FARR finds a list of Rs rather than Ks.  Does this mean in order to make use of *any* arguments, the user is obliged to have set up an alias in advance?  Thanks again.


mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 40,896
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #4 on: May 26, 2008, 01:53 PM »
i think you are right in everything you are saying, and you've made a convincing case that FARR needs a simple way to provide arguments to a program you are about to launch.

can we come up with a general purpose syntax for this?

note that it cannot be as simple as saying that everything after the program name is an argument, because by default FARR wants to use additional typed words to filter the search.

it needs to be something like:

k-meleon :: args_go_here
C:\Program Files\K-Meleon\k-meleon.exe  www.google.com :: args_go_here

where :: is a special separator meaning EVERYTHING after this on the search string will be treated as arguments passed to an executable launched.

it might be nice if instead of :: we used something more flexible for other purposes, for example some syntax like:
k-meleon /ARGS args_go_here

So that we could use /KEYWORD for other special stuff

Or we could use our existing + prefix that we use for modifiers and say that some modifier keywords are reserved for special purposes.  this might make sense, so that
k-meleon +args args_go_here

JLeiderman

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #5 on: May 26, 2008, 04:20 PM »
Mouser - Thanks very much for your instantaneous response!

I understand that FARR must by default look for more search terms as the entry is expanded.  But I thoroughly endorse your last thought of using some marker of arguments.  My personal preference is for one or two "escape" characters at most:

k-meleon ::argument_terms or  k-meleon \+argument_terms

preferable (from the point of view of typing) to k-meleon +args argument_terms

In the same vein, I appreciated discovering the +sall modifier to expand search results, but found it a bit more than ideal to type.  The longer +term syntax has the virtue of clarity for macros and aliases, but strikes me as longish for routine keyboard use.

Thanks again for your extraordinary work.

Josh


herojoker

  • Participant
  • Joined in 2008
  • *
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #6 on: May 26, 2008, 06:11 PM »
I vote for a key (not a character) to create separators for passing arguments. For example such a key could be the Tab key, the Caps Lock key, a Win key or whatever a user wants. I'm not sure about the internals of FARR but I think the command line of FARR shouldn't be limited to text but objects in general. This means: A command could be made up of a chain (or even a net!?) of objects. Some of them are plain text, others are separator objects etc.. How these objects are created is an other topic (ok, for text it's clear; other possibilities are the special keys or key combinations; system events etc. etc.). Such objects may change the behaviour of the input line completely. For example some parts of the input line may become uneditable (as a little separator arrow) or only changeable within certain limits (as a mini-dropdown menu). They could even change the whole input line while being created... (i would call them transformers) (stay calm... I'm only flushing ideas ;) ) Some of them might become invisible just as they have been typed.
There may be even access rights for these objects such that a certain object may only read the next N entries in the command line.
An object to denote a single string would be nice too (compare the whole string "foo bar" with the single words "foo" and "bar").

To sum up: Just because a launcher is keyboard based it hasn't to be text based!

Perhaps you could use some of the ideas Mouser :P (especially the "key creates separator" would be nice...)

P.S.: "Enter" would just instantiate another object which immediately opens the selected result. There might be other keys for that!  E.g. Shift+Enter for "open result" and "Enter" for "line break".
« Last Edit: May 26, 2008, 06:52 PM by herojoker »

kartal

  • Supporting Member
  • Joined in 2008
  • **
  • Posts: 1,529
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #7 on: May 26, 2008, 06:34 PM »
Tab is my favorite.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #8 on: May 26, 2008, 07:15 PM »
This is something that has come up quite a lot as well as something i have mentioned several times. There are so many times while using farr that i think how cool it would be if you could build a sentence by stringing multiple arguments together. Not only would it make farr a lot more powerful but a lot more intuitive at the same time. For example as others  already mentioned using the tab key as well as the enter key to denote multiple arguments as well as the end of the "sentence"  respectively would be awesome!! My vote would be for the following system:

1.start typing name of alias/plugin/etc
2.once identfied hit tab to select
3.now continue typing the search phrase or first argument. incidentally this would also be a great place to use a specific or shared history for that alias as i have mentioned in other threads  :D
4.hitting tab again would simply take you to the next argument if there are any or hitting enter would signify that you are finished and trigger the action with all the arguments etc.

I would also add that the use of any special characters in any of the steps above should bring up a list that can be filtered by continued typing for all the relevant functions for that special character. For example lets say you find the file you are looking for and you than type + , the results window should now display all the modifiers avail such as +zip,+email,+encrypt, etc.. What this also does is allow you to simply start typing the name of the action you would like to use and than pick the corresponding action below instead of having to memorize the exact modifier phrase with no assistance from farr which can be difficult depending on the number of modifiers,alias, etc.. This kind of intelligence is something that other launchers do well that i feel farr i sorely missing.

Just as powerful would be to have the last "step" of any sentence emulate the right click system context menu that you can currently get by right clicking on a result. This list could than be filtered by continued typing and ultimately hitting enter to perform the action. By doing this you could have all the actions available to that specific file type.

Just my .02

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #9 on: May 27, 2008, 06:31 AM »
1.start typing name of alias/plugin/etc
2.once identfied hit tab to select
3.now continue typing the search phrase or first argument. incidentally this would also be a great place to use a specific or shared history for that alias as i have mentioned in other threads   
4.hitting tab again would simply take you to the next argument if there are any or hitting enter would signify that you are finished and trigger the action with all the arguments etc.

this seems like a nice workflow...
i am too convinced that tab is the best "key" for that

but however i'm wondering if FARR should not have other boxes in addition to the search box maybe two more, an argument box and one for FARR specific modifiers
it would nicely separate the strings, would make it intuitive to shift+tab to go back, etc... i would imagine them one on top of the other... (so that resizing would not be an issue, and it gives more room...)
they could also be hidden (optionally) for rookie use...

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #10 on: May 27, 2008, 09:20 AM »
There are so many times while using farr that i think how cool it would be if you could build a sentence by stringing multiple arguments together.

Are you suggesting that we could define FARR "macros" (for want of a better word), where the command and various arguments could be defined, eg

command copy;move;shortcut @E @E


where "command" is the name of the alias (is that the right word), "copy;move;shortcut" are three options that can be selected/typed in for the first argument and the two @E's are type-ins for the second and third arguments (that will have their own histories to select from)???

Hmmm: that sounds awesomely powerful!!

Lashiec

  • Member
  • Joined in 2006
  • **
  • Posts: 2,374
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #11 on: May 27, 2008, 12:01 PM »
Either a key or a character, it has to be something accessible. FARR biggest feature is how faster you can do most things, and if we use "exotic" characters, we'll hit a speed bump.

s.newave

  • Supporting Member
  • Joined in 2006
  • **
  • default avatar
  • Posts: 124
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #12 on: May 27, 2008, 03:23 PM »
There are so many times while using farr that i think how cool it would be if you could build a sentence by stringing multiple arguments together.

Are you suggesting that we could define FARR "macros" (for want of a better word), where the command and various arguments could be defined, eg

command copy;move;shortcut @E @E


where "command" is the name of the alias (is that the right word), "copy;move;shortcut" are three options that can be selected/typed in for the first argument and the two @E's are type-ins for the second and third arguments (that will have their own histories to select from)???

Hmmm: that sounds awesomely powerful!!
-Perry Mowbray (May 27, 2008, 09:20 AM)

Exactly! There is another launcher called Dash which did this very well although it seems to have died off as of late.

but however i'm wondering if FARR should not have other boxes in addition to the search box maybe two more, an argument box and one for FARR specific modifiers
it would nicely separate the strings, would make it intuitive to shift+tab to go back, etc... i would imagine them one on top of the other... (so that resizing would not be an issue, and it gives more room...)
they could also be hidden (optionally) for rookie use...

Sounds like a familiar mac app i have heard of :D. My only issue with this approach is that it potentially limits you to 3 actions. Whereas if you look at the app i mentioned above you could have many more steps to use when "building a sentence/macro". It also has a very clever way of handling this as well as providing feedback to the user as to which step they are currently at.

Some potential workflows could be (-> represents a tab):
Email->email address->subject->body<enter> 
Addnote->notename->title->body<enter>
File->zip->filename->directory<enter>
Possibilities are endless.....

This way it is up to the alias/plugin to determine the number of steps needed/required. It is this intelligence that i wish farr had and i keep asking Mouser for  :D
« Last Edit: May 27, 2008, 07:53 PM by s.newave »

nitrix-ud

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 560
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #13 on: May 28, 2008, 02:46 AM »
Sounds like a familiar mac app i have heard of . My only issue with this approach is that it potentially limits you to 3 actions. Whereas if you look at the app i mentioned above you could have many more steps to use when "building a sentence/macro". It also has a very clever way of handling this as well as providing feedback to the user as to which step they are currently at.


yes you are right the stack approach is very quicksilver-ish  :D

i also know dash (i even bought it ;)) it seemed like an excellent start but like you said it is kind of dying as of now

on thing i love about FARR is that you can specify multiple results for one alias, which is not the case for dash, with farr for a web search i just type : g keyword1 keyword2
then i choose the search engine...

with dash you would have to create a plugins...
Search->keyword1 keyword2->choose engine<enter>

well that's great too, but only if anybody can do it !

Perry Mowbray

  • N.A.N.Y. Organizer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 1,817
    • View Profile
    • Donate to Member
Re: Looking for a little help with arguments.
« Reply #14 on: May 28, 2008, 09:02 AM »
Some potential workflows could be (-> represents a tab):
Email->email address->subject->body<enter> 
Addnote->notename->title->body<enter>
File->zip->filename->directory<enter>
Possibilities are endless.....

This way it is up to the alias/plugin to determine the number of steps needed/required. It is this intelligence that i wish farr had and i keep asking Mouser for  :D

How about this, in conjunction with your Email, multiple alias...
Email (Work)->joe@work;ken@work;helen@work->subject->body<enter>

Where the work email is a second alias match that has predefined email address that can be selected, or typed over (hey, wouldn't be neat if FARR could update these sentance/macros so that if you enter a new email address FARR asks "Did you want to store this email in the definition?"); plus the ability to have FARR present previous histories of subject + body for that alias would be real nifty.

That would make FARR into a nifty front end to all sorts of batch files, commands, scripts, etc too!