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
Post a Comment