osx - mdfind with single quotes -


i'm writing applescript find file me based on filename including extension. script uses mdfind in bash shell. i've had luck construction:

mdfind name:'"filename.avi"'

but breaks down when filename has single quote (apostrophe) in so:

mdfind name:'"mst3k - s05e13 - brain wouldn't die.avi"'

i've tried escape single quote backslash no dice:

mdfind name:'"mst3k - s05e13 - brain wouldn\'t die.avi"'

what doing wrong? thanks.

try this, , inspect result, see how should quote apostrophes, should of course remove double quotes. , should open man page mdfind, see how name command peformed.

set q quoted form of "mst3k - s05e13 - brain wouldn't die.avi"  set res shell script "mdfind -name 'mst3k - s05e13 - brain wouldn'\\''t die.avi'" 

Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -