Yes, he probably did, in a foreign language, which is the entirety of that post you referenced as well. I had previously read that post several times, but I don't know how to program Python, so I don't understand the underlying logic of it.
What I do know is that I have tried several methods Google says are "escaping spaces" to no avail. As you can see in my earlier screenshots, I've tried quotations marks, using a set variable kmVar action with the path (with quotes, without quotes), then using "$KMVAR_kmVar" in qutoes and without quotes, /Library/Frameworks/Python.framework/Versions/3.7/bin/python3 in quotes and without quotes, "/Users/pariah/Dropbox/_Crucial Files/System - Mac/Mixcloud_Uploader/main.py" in quotes and without quotes... As per the discussion in How to escape spaces etc. in when passing variable to shell .
I get that you're trying to teach a man to fish, but at a certain point, when the man doesn't live near the water or know how to bait a hook yet still needs to eat that day, he has to ask someone to catch him a fish while he learns. I'm asking you, @mrpasini , @ComplexPoint , and @JMichaelTX , to please tell me explicitly what to write to make this thing I've been researching and trying unsuccessfully to solve for myself for more than two weeks work. Please.
You've seen this thread and my posts in the forums the last three years: I do my best to help myself and to learn before I ask for assistance. I'm far out of my league here. I don't want to learn to program in Python. I asked someone to help me solve a problem. The solution was a Python script. Now I need help simply executing that Python script from KM. I hope you will tell me how to do that without responding, again, as if I have some knowledge of Python or Shell programming.
Run just the Python part of your shell script with one argument (say, "python3 -h) and if that works go to step two.
Run Python with the literal .py and .yaml filenames (no variables), double quoting them. I think you said that works too.
Now try constructing your variable .yaml filename (the one that's apparently causing all the trouble) and just displaying it. Is that what you are after (none of us can tell from over here)? If so, continue.
Substitute the .yaml filename with the variable being sure to double quote it.
If you get this far and it doesn't work, report what version of macOS are you running (it matters). And while you're waiting around for more fish, try removing any underscores from your filenames on Dropbox.
3a. "just displaying it. Is that what you are after (none of us can tell from over here)?" I don't understand. I want to execute the same command as #2 above, but with replacing "/Users/pariah/Dropbox/Projects Files/Hard, Heavy & Hair/Shows - Distros/HHH 272/HHH_272.yaml" with "%PathHHH%/Shows/0%Variable%HHHShowNumber%/OUTPUT/HHH%Variable%HHHShowNumber%.yaml"
Do not run your shell script for this step. I just want to test if you are constructing your path and filename as you think you are.
So just use the Display Text action to show "%PathHHH%/Shows/0%Variable%HHHShowNumber%/OUTPUT/HHH %Variable%HHHShowNumber%.yaml" after you have set the path and variables for it.
If that is "/Users/pariah/Dropbox/_Projects Files/Hard, Heavy & Hair/Shows - Distros/HHH 272/HHH_272.yaml" as you indicate and that file does indeed exist then try (just as a test) simplifying the yaml path and filename to something like "/Users/pariah/Dropbox/test/HHH272.yaml" (since that's the file that the shell can't find.
Yeah, on 10.15.7 I believe you are using the Z shell by default instead of the Bourne shell. Not familiar with Z since I'm still on High Sierra.
Thank you. Here's what I ran--each one at a time, all successful. I figured the next logical step after a Display Text action would be to try to act on the variable, so I set it to open. It did open. When I made a copy in Dropbox/test, it also opened. Is this what you needed to see?
Well, that runs (in a manner of speaking). You got further with the simple yaml filename. Correct?
If Python had been able to successfully execute the command you gave it, it would have returned (invisibly) an exit code of zero. The one means there was a problem.
Since your Python is a black box to me (and the rest of us), I suggest you confirm your installation with your Python coder. It could be that Python couldn't find some file it depends on and aborted, exiting with status 1.
Incorrect. It's the exact same result between the two tests--the original path and the simplified path--both "Task failed with status 1".
What confuses me about that statement is that Python fully runs successfullyoutside of KM. I only get errors when trying to run the script inside a Shell Script action.
cd to the directory containing main.py
And run the command ./main.py "/Users/pariah/Dropbox/_Projects Files/Hard, Heavy & Hair/Shows - Distros/HHH 272/HHH_272.yaml"
...everything works perfectly. The script is found, processes the .yaml file input, and does everything exactly as it's supposed to, without errors.
Only when trying to run it with a variable in KM do I have problems, which is why I came to the KM forums to look for a solution. Then, finding none that I could A) understand and B) make work, I started this thread to ask the community for assistance.
This is like pulling teeth just to get something that should be simple to run. Nevermind.
Thank you for the attempted help, @mrpasini. I genuinely appreciate it, but I'll just do this without a Shell Script action. The below, though less elegant than KM should be able to accomplish, works 100% of the time without error.