I'm trying to make AppleScript to execute Python 3 script:
on run {input, parameters}
tell application "Terminal"
do shell script "/usr/local/bin/python3 /Users/UserName/Desktop/PyHello.py $@"
end tell
return input
end run
but I'm still getting an error 1721. I tried different types of file as well as changing Command Line command from:
/usr/local/bin/python3 /Users/UserName/Desktop/PyHello.py $@
to
/python3 /Users/UserName/Desktop/PyHello.py $@"
Both commands:
/usr/local/bin/python3 /Users/UserName/Desktop/PyHello.py $@
and
/python3 /Users/UserName/Desktop/PyHello.py $@"
Run OK, when typed directly within the Terminal.
Best Answer
Thank you user3439894 on the basis of your answers I was able to figure out the problem.
That's the correct script for AppleScript:
This script is for Automator to run AppleScript:
Also following shebang is needed in initial Python script: