I have a python script I want to be able to drag-drop files on to. So I've wrapped it in an Automator Application. Said Application has a single Run Shell Script
with contents that look something like:
export PATH=${PATH}:/usr/local/bin:/usr/local/CrossPack-AVR/bin
cd /Applications/MyApp
/Applications/MyApp/doIt.py "$1"
This works. My python script runs with $1
showing up in its sys.argv[1]
. Said script produces quite a bit of output though. I'd like to open some sort of window that shows the output as it happens. I don't mind if the user has to close it. I don't see anything in Automator
's actions that do that. I've tried to do something like:
open -a Terminal /Applications/MyApp/doIt.py "$1"
Unfortunately, that doesn't seem to inherit the environment. Nor does it hand the $1
to the python script, but tries to open it as well.
So I'm looking for a way, to open something (Terminal or whatever) that can capture and scroll the stdout of that script while it runs, as invoked from within the script.
$$
to name tmp files is frowned upon as it can generate security holes. TL;DR—Usemktemp
. https://mcmap.net/q/150121/-what-does-mean-in-the-shell – Bayly