I would like to use mdfind to find PDF files with a search text. The search for the text works without problems, but if I then add further arguments (only pdf files) and put them in ' ... ' Keyboard Maerstro does not accept this.
The following instruction is executed successfully in the terminal, not in KeyboardMaerstro:
mdfind 'kMDItemTextContent == $KMVAR_searchTXT" && kMDItemFSName == "*.pdf"'
this on execution successfully in Keyboard Maestro:
mdfind kMDItemTextContent == $KMVAR_searchTXT"
As both @ccstone and @peternlewis have noted, using quotes in a complex shell script is tricky. Take a look at this macro and see if it will help solve your problem. Sorry I don't have time right now to debug your specific use case.