Calling an app from the terminal via script I try to call an application from the console and pass it an argument. This is the script I am using:

#!/bin/sh

open -a "/Applications/MyApp.app/" $1


Somehow the OS is unhappy with this and complains:

FSPathMakeRef(/Applications/MyApp.app) failed with error -43.


What can I do?
That looks like /Applications/MyApp.app doesn't actually exist. 

You can test for that in your script, perhaps like this:

#!/bin/sh
APP=/Applications/MyApp.app
if [ ! -d "$APP" ]; then
  echo &gt;&amp;2 "$0: $APP not found."
  exit 1
fi
exec open -a "$APP" "$@"