Skip to content

Instantly share code, notes, and snippets.

@tjluoma
Last active February 27, 2020 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjluoma/c16a99895eab790a8eb5b5e352561eae to your computer and use it in GitHub Desktop.
Save tjluoma/c16a99895eab790a8eb5b5e352561eae to your computer and use it in GitHub Desktop.
BBEdit script to open the current file in Marked 2
#!/usr/bin/env zsh -f
#
# Author: Timothy J. Luoma
# Email: luomat at gmail dot com
# Date: 2018-08-23
#
# Purpose: BBEdit Script to open the current file in Marked 2 <http://marked2app.com>
NAME="$0"
PATH='/usr/local/scripts:/usr/local/bin:/usr/bin:/usr/sbin:/sbin:/bin'
SETAPP_VERSION='/Applications/Setapp/Marked.app'
STANDALONE='/Applications/Marked 2.app'
if [[ -d "$SETAPP_VERSION" ]]
then
APP="$SETAPP_VERSION"
elif [[ -d "$STANDALONE" ]]
then
APP="$STANDALONE"
else
echo "$NAME: nothing found at '$SETAPP_VERSION' or '$STANDALONE'."
exit 2
fi
if [[ "$BB_DOC_PATH" == "" ]]
then
echo "$NAME: No 'BB_DOC_PATH' set"
exit 1
else
open -a "$APP:t:r" "$BB_DOC_PATH"
fi
exit 0
#EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment