I have a modest (~250 lines) python3 script using tkinter and subprocesses. The python script launches a macOS app using the "run" subprocess.
Python defined functions then query the system for information on the spawned app.
Everything works fine when I run the Python code directly from the shell, from within BBEdit, or within PyCharm but fails if I build it into an app using either Platypus or Automator.
I've added osascript, Platypus, Automator, System Events, and the built app to the "Accessibility" settings pane (in Privacy & Security)and tried several logout/ins and restarts.
No Joy!
errAENoSuchObject
, so it may not necessarily be a permissions issue. Note thatosascript
inherits its environment from the shell it is run from.do shell script
do not read any configuration files, so $PATH will not reflect any of your changes - you will need to set up the shell environment or use full paths. In addition, a current working directory is not set, so that would also need to be set for anything that expects one.