It's not Apple shit, it's Unix shit. And if you are going to use, or write macros for, Unix utilities that are installed outside of /usr/bin
, /bin
, /usr/sbin
, or /sbin
you had better get used to it.
The easiest method (for you, anyway) is to check if the user has been smart enough to update KM's ENV_PATH
variable to suit however they've installed ffmpeg
:
You can also do as @griffman shows above, although that only covers a couple of cases.
If you have time to spare you could try and find
it and get the path from the result:
...though it would better to do that only once -- store the result in a global variable and only do the find
if the variable does not exist or the which
test fails.
If you can be sure that they haven't excluded the directory from Spotlight, a Spotlight search will be much quicker, and you wouldn't need to save the result:
(The command is mdfind -literal "(kMDItemDisplayName==ffmpeg && kMDItemKind=='Unix Executable File')"
, so you can easily see the quotes.)
And I'm sure there are other methods.
So yes -- there's a bunch of ways you can solve this problem, with varying degrees of success, once you've understood what the problem is.