Jump to content

How to escape "," in dynamic snippets?


Recommended Posts

36 minutes ago, vitor said:

I’ve made a few tests and was unsuccessful

 

Same as that. When using such a common character as the comma as a delimiter, it really needs to be possible to escape it with a backslash or a double comma.

Link to comment
Share on other sites

  • 1 year later...
On 7/20/2019 at 1:59 AM, deanishe said:

Same as that

I use snippet to help me remember many linux commands, such as setting ps -ef | grep {clipboard}, if the value of the clipboard contains points, for example, I run a shell called b.sh,  "ps -ef | grep b.sh" will also filter out /bin/bash and other information. The correct one should be "b\ .sh". I hope sinppet can provide escape transform utility .

Link to comment
Share on other sites

7 hours ago, SummerChill said:

The correct one should be "b\ .sh".

 

I wouldn’t hold out much hope for this one. Escaping is for writing coding, and I don’t think code-formatting features really belong in Alfred’s macro expansion. A lot of fields support macro expansion, so you’re kinda asking for every text field to be changed because the text might end up as an argument in a shell.

 

I think a more appropriate approach would be to write a workflow that formats the text on the clipboard according to whatever rules. Perhaps add a Script/List Filter to the workflow so you can choose different escaping schemes (bash, grep etc.).

 

Perhaps add a Hotkey (say ⌥⌘C) that pastes the clipboard contents escaped for a shell.

Edited by deanishe
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...