andy4222 Posted February 19 Share Posted February 19 (edited) Hi Alfred team, right now we can pass one argument via External Trigger (ET). Any way to pass in multiple args? I think maybe we can pass in all args in a single string and then split them, but that requires work to be done in every single workflow. Any good way to pass in multiple args? Something like: `alfred://runtrigger/com.alfredapp.abc/mysearch/?argument=test&argument2=test2` Please share other ideas/suggestions. An example workflow would be great. Edited February 19 by andy4222 Link to comment
andy4222 Posted March 21 Author Share Posted March 21 (edited) @vitorcould you please guide me a little here? Any example should work. Edited March 21 by andy4222 Link to comment
vitor Posted March 21 Share Posted March 21 You can only pass one argument with the URL scheme. Link to comment
andy4222 Posted March 21 Author Share Posted March 21 Oh, got it 🙁 . I supposed I'll have to have either decode everything as base64 or some other trick. How do I extract that one arg out though? Link to comment
Andrew Posted March 22 Share Posted March 22 @andy4222 The way I'd approach this is pass the single argument in the URL as comma or pipe separated, then add a Split Arg object after which can split this into either variables or multiple arguments depending on how you want to use it within the workflow. Link to comment
carllx Posted June 18 Share Posted June 18 (edited) Are there any updates on resolving the issue of sending multiple arguments? Thank you. Currently, I'm using a separator to pass multiple arguments, but it's very clumsy. const sep = "******"; const args = `${itemID}${sep}${path}${sep}${contentType}`; Zotero.HTTP.request( "GET", `alfred://runtrigger/AIAssistants/upload/?argument=${args}` ); Edited June 18 by carllx Link to comment
andy4222 Posted June 18 Author Share Posted June 18 Would love if the Alfred team implements something easier/faster to use. I like how Things does it 🙂 Link to comment
andy4222 Posted June 19 Author Share Posted June 19 Another idea is could be having an Automation Task do this for us 🙂 Link to comment
vitor Posted June 19 Share Posted June 19 URLs don’t have the concept of an arbitrary number of arguments, everything is either part of the path or a named parameter. Which is what the Things example is doing, changing different known options, each with a single value. It’s fundamentally different to what you’re trying to do with Alfred, that interface wouldn’t make sense it that context. Similarly, there’s nothing about Automation Tasks that would be different than what you should already be doing. If you want to call externally via a URL with an arbitrary number of unnamed arguments, you have to split on something, as @Andrew described above. Link to comment
andy4222 Posted June 19 Author Share Posted June 19 (edited) My bad if I wasn't clear, but at least what I meant was named args. my wish: `alfred://runtrigger/com.alfredapp.abc/mysearch/?argument=test&argument2=test2` what Things does: `things:///add?title=test&completed=true&show-quick-entry=true` And maybe in Alfred objects and be able to say `{var:argument2}` and gets the arg value? Edited June 19 by andy4222 Link to comment
vitor Posted June 19 Share Posted June 19 To clarify further, what you’re asking for are variables. Which is what Things is doing in the example (a title variable with the value text, a completed variable with the value true, and so forth). As I’ve explained before, it is using fixed parameters to configure known fields, which is very different from your request, which is to have arbitrarily named key/value pairs (i.e. one could just make up argument2 and more). That surfaces its own class of problems. How would one distinguish between the argument passed to Alfred and a variable called argument? And what to do about those already relying on the feature as is? Plus it closes the door on the URL handler gaining extra features, because then no new simple keywords could be added as those might break existing workflows that used those same words. Your request is noted, and no one is saying it won’t ever happen. But I’m asking that you have confidence we do things in certain ways for good reason. Those reasons are what keeps Alfred lean, fast, and stable, even on pre-releases. I’m not explaining the constraints to be contrarian—quite the opposite, I’m doing it so you understand them and can think up improved suggestions or solutions for yourself. That is the way to becoming a better developer and designer. It’s important to never forget everything in software exists in a context, and ideas need to make sense for a wide range of users. We think long and hard about these issues. Though right now it’s also very worth it to think about and appreciate the view that is passing me by. Trees trees trees, green everywhere! I’ll stare at it a bit more and let these ideas marinate further. I wish you a pleasant and relaxed week. andy4222 1 Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now