--- /dev/null
+#!/usr/bin/env bash
+
+ARG1=$1
+DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
+APP=${DIR%/Contents/*}
+
+if [ "${APP}" = "${APP%.app}" ]; then
+ echo "Could not find .app dir" >&2
+ exit 1
+fi
+
+# check to see if $1 is set and is not start of other cli set args
+OPEN=""
+if [ -n "$ARG1" -a "$ARG1" = "${ARG1#-}" -a \! "$ARG1" = "open" ]; then
+ # first argument exists and does not start with a "-" and is not "open"
+ OPEN="-open"
+fi
+
+APPDIR="${APP}/Contents/Resources/app"
+JAVA="${APPDIR}/jre/Contents/Home/bin/java"
+GETDOWNTXT="${APPDIR}/getdown.txt"
+# always check grep and sed regexes on macOS -- they're not the same
+if [ -e "$GETDOWNTXT" ]; then
+ CLASSPATH=""
+ for x in $(grep -e 'code = ' "${GETDOWNTXT}" | sed -e 's/^code\s*=\s*//;'); do
+ [ -n "$CLASSPATH" ] && CLASSPATH="${CLASSPATH}:"
+ CLASSPATH="${CLASSPATH}${APPDIR}/${x}"
+ done
+else
+ echo "Cannot find getdown.txt" >&2
+ exit 1
+fi
+
+"$JAVA" -cp "$CLASSPATH" jalview.bin.Launcher $OPEN "$@"