1

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!

4
  • I have no idea if this would work [nor why it worked for me] - apple.stackexchange.com/a/411652/85275
    – Tetsujin
    Commented Jan 22, 2023 at 17:30
  • Error -1728 is errAENoSuchObject, so it may not necessarily be a permissions issue. Note that osascript inherits its environment from the shell it is run from.
    – red_menace
    Commented Jan 22, 2023 at 18:34
  • The script runs fine when launched in zsh or bash. When I use Automator to build an app I only use the 'run shell' thing from the library and specify my script as the target,; that does not run (same error).
    – user484944
    Commented Jan 22, 2023 at 22:26
  • Automator's Run Shell Script and AppleScript's 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.
    – red_menace
    Commented Jan 23, 2023 at 6:14

1 Answer 1

0

Problem solved or at least, identified.

I had chosen a space separated, two word name for the app I was trying to build. I was testing the generated app which produced the problem.

Oh a hunch I replaced the space with an underscore and the Automator produced app ran, after prompting for the necessary permissions. Sadly, the Platypus generated app still won't run.

I say sadly because the Platypus generated app is less than 1/3 the size of the Automator one.

In any event, thanks to all who offered hints, clues, and assistance.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .