3

I used to wrap my shell scripts in some .app bundles to make the scripts more accessible for my coworkers. To do so I created the folder structure and saving the .plist file along with the .icns and of course the executable shell script. Since I updated to Catalina I have some issues executing the .apps. It is executing the script, but is not able to call other programs, it seems like.

In this test the log is written but ffmpeg never starts. I can run the shell script manually in terminal though without any problems. I suspect some security mechanism but I don’t get any prompt to grant permission neither.

#!/bin/bash

echo "test" >> ~/Downloads/test.log
ffmpeg -i ~/Downloads/MVI_1146.mp4 ~/Downloads/MVI_1146_out.mp4
Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
florit
  • 325
  • 2
  • 13

1 Answers1

0

I don't know why your approach is not working, but as an alternative, I suggest using Automator. Make a "Run Shell Script" action and save as an app.

JWWalker
  • 22,385
  • 6
  • 55
  • 76
  • Ouch, /usr/local/bin was simply not in PATH when running the .app. When I added ```PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/bin``` to the beginning of the script, everything was working fine. Which PATH is loaded when launching the .app? Is it possible to set the environment variables in the plist file? – florit Dec 05 '19 at 07:38
  • Interesting. I had tried a script in an app, using a different command than ffmpeg. I tried giving the full path to the command and it still didn't work for me. Anyway, yes, you can set environment variables in Info.plist. See `LSEnvironment` in https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/LaunchServicesKeys.html. – JWWalker Dec 05 '19 at 16:10