/Volumes/SamSSD-1TB/Dropbox/PWB - Meins/Fragebogen INCOMING/_Incoming/Höfling, Petra - ABC/Höfling, Petra - ABC (dragged) 15.pdf
If I prepend "echo" to the script and execute it, everything looks perfect. I can just copy what is echoed and paste it into Terminal and it executes perfectly.
Is there any reliable way of using a path variable from "For Each Finder Selection" in a shell script? Something that will always work?
Apparently, KM interpreted the output delivered by mdimport as an error message and filtered it. Or something like that.
Thank you, @JMichaelTX for putting me on the right track. Who knows how much more time I would have wasted hunting down errors with paths, variable, single quotes and double quotes...
In unix, scripts (all programs really) have one input, called STDIN, and two outputs, called STDOUT and STDERR. STDIN is the input stream. STDOUT is the output stream, and STDERR is the errors output stream. The "Include Errors" in the Keyboard Maestro action means that the output from STDERR is included.
mdimport is outputting the debugging information you are requesting to the STDERR stream (which is normal for debugging information).