Jump to content

Recommended Posts

Posted

I think I've found a typo in Alfred Preferences > Features > File Search > Advanced

 

DiMfbIL.png

 

I believe the proper escaped path should be 'Users/preppeller/Desktop/Andrew\'s Folder!/', i.e. the apostrophe isn't escaped and/or there's an erroneous double quote in text.

Posted

@deanishe if you create a folder called Andrew's Folder! on your desktop and copy it from Alfred, you'll see it's copied literally as shown (which can then be used e.g. for a cd in bash).

 

What's happening is the entire path is wrapped in single quotes, then the single quote before the backslash is the end of the string literal, then it's adding a single quote with \', then it's adding the end of the path as a string literal in single quotes.

 

There are alternative ways this could be escaped, i.e.

 

'/Users/preppeller/Desktop/Andrew'\''s Folder!'

/Users/preppeller/Desktop/Andrew\'s\ Folder\!/

 

... but many years ago, when this was first done, there was a reason I went with wrapping the entire path in single quotes. I think it may have been to do with UTF8 characters, but don't quote me on that.

 

Cheers,

Andrew

 

Posted

Ah, right, it's two single quotes, not one double. Also, I forgot that backslashes don't escape characters in single-quoted strings in bash.

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
×
×
  • Create New...