johnjddoe Posted March 27, 2013 Share Posted March 27, 2013 Alfred provides fairly decent escaping of parameters that works for the majority of use cases (so this isn't terribly high priority). However, Alfred still doesn't account for all possible inputs. For all special characters, see http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html. Since there's so many, I think instead of allowing the user to tick and untick each one, you should provide a few options using radio buttons. Something like "All", "Double quotes" and "None" (and possibly "Custom"). You should also make clear somewhere how "All" should be used, i.e. does {query} need to be in double quotes or not: python myscript.py {query} vs python myscript.py "{query}" mklement0 1 Link to comment Share on other sites More sharing options...
nikipore Posted March 27, 2013 Share Posted March 27, 2013 I suggest to introduce a "streaming" mode which sets up the communication Alfred <-> subprocess via stdin and stdout of the subprocess. It would be optimal if the encoding was specified explicitly, I propose normalized UTF-8 (not Mac UTF-8). Since the stdout route subprocess -(stdout)-> Alfred is already there, this would symmetrize the communication. mklement0 1 Link to comment Share on other sites More sharing options...
mklement0 Posted April 24, 2013 Share Posted April 24, 2013 (edited) +1. (Sadly, this problem has been around a long time and only recently, after a long period of languishing, has received a bit of attention with the added option of escaping backslashes.) In particular, a single, aggregate option to escape the entire query for use in bash would be great. As of Alfred 2.0.3, one has to jump through the following hoops to achieve that: Opt to escape ONLY the following characters in Alfred:Backquotes Double Quotes Backslashes Dollars Use double-quoting to refer to query: "{query}" Incidentally, if you want to play interactively with how the shell escapes strings, use: printf '%q\n' 'inputString'. Similarly, Applescript's "quoted form of" can be used to experiment: quoted form of "Honey\\(`sweetie`), I'm $HOME." Here's a piece of text that can serve as test input to see if it can be passed through without any modification (e.g., by echoing {query} and redirecting to a file): It ain't "easy".a\b \\servera|b & moretest: `ls`; also: $( ls )$HOME, sweet \$HOME - \a! Edited April 24, 2013 by mklement0 _mk_ and mannieschumpert 2 Link to comment Share on other sites More sharing options...
mannieschumpert Posted November 6, 2013 Share Posted November 6, 2013 In particular, a single, aggregate option to escape the entire query for use in bash would be great. Yes, please! As of now, there seems to be no way I can get my workflow for Asana working just right, because there isn't an option to escape single quotes. Link to comment Share on other sites More sharing options...
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