Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capture all arguments? #1

Open
glenviewjeff opened this issue Oct 28, 2018 · 8 comments
Open

Capture all arguments? #1

glenviewjeff opened this issue Oct 28, 2018 · 8 comments

Comments

@glenviewjeff
Copy link

Hi everyone, I was able to get Serge's fork to work with individual
arguments ({1}, {2}, etc.) but can't seem to figure out how to pass
all/variable # of arguments (e.g. {*}). Launchy's runner plugin allows
this, and I need it for commands such as sending a text message or
executing commands that accept variable #'s of optional arguments, etc. Is
this implemented with a secret syntax or just not implemented?

@ghost
Copy link

ghost commented Oct 2, 2019

Hello All,

Was this issue ever resolved? What is the syntax for passing an unspecified number of arguments? I tried {*} and (*) and "{*}" -- none of these seems to work.

image

@glenviewjeff
Copy link
Author

I don't think the developers are following the fork; they never responded. As far as I can tell, this isn't supported, which sadly keeps me from using Wox. I haven't had the time and energy to set up a development environment to learn how to build a plugin and fix this problem. Incidentally, there are a couple of other forks of this plugin but developers didn't respond there either.

@ghost
Copy link

ghost commented Oct 2, 2019

Thanks for the quick response. I am starting to reconsider using Wox myself.

Another thing I'm not sure about is how to pass multiple words to arguments. Hopefully I'm just doing something wrong?
For example, when Arguments is set to {0} {1} {2} and I execute it like test one two three, I get the expected result (3 arguments).
But if instead I try multiple words in one parameter like this test one "more than two words" three, the result is only two arguments: one and more than respectively -- the rest is lost!

@glenviewjeff
Copy link
Author

Yes, I too tried a number of workarounds, all of which fail. I tried adding way more arguments than I'd need, but the C# format method that the plugin uses requires that all of the arguments be provided or else it returns an error, which is passed back to the user in Wox. Enclosing a multi-word single argument in quotes also fails. My next thought is to look at reusing the code from the web searches plugin, which uses the "{g}" keyword to insert all entered arguments. I downloaded Visual Studio, which I've never really used, but I'll give it a shot because it seems to be an otherwise worthy upgrade of Launchy. For now, I'm running both Launchy and Wox simultaneously.

@glenviewjeff
Copy link
Author

glenviewjeff commented Oct 6, 2019

Here's the plan:

From web searches plugin code reuse this snippet:

string keyword = query.Search
searchSource.Url.Replace("{q}", Uri.EscapeDataString(keyword))

Like this inside GetProcessArguments in Runner.cs, replacing line 77 with something like:

if (c.argumentsFormat.Contains("{a}")) {
   searchSource.Url.Replace("{a}", Uri.EscapeDataString(keyword));
} else {
  argString = String.Format( c.ArgumentsFormat, arguments.ToArray() );
}

By the way I have no idea why line the Replace() method is called from a new process in the web search code, so I pulled it out. I'm not a C# developer, but this makes no sense to me. Also, I don't see where the searchSource string gets cloned, but maybe for some reason C# does this implicitly? Also makes no sense to me.

@glenviewjeff
Copy link
Author

glenviewjeff commented Jan 1, 2020 via email

@jjw24
Copy link

jjw24 commented Feb 12, 2021

While porting and fixing the Runner plugin for Flow Launcher I can't help but notice there are some struggles with this Runner argument issue. Thought better late than never, this issue should be resolved with the Flow Launcher port if you ever want to give it a second shot.

@glenviewjeff
Copy link
Author

glenviewjeff commented Feb 12, 2021 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants