Last active
February 27, 2020 21:39
-
-
Save tjluoma/c16a99895eab790a8eb5b5e352561eae to your computer and use it in GitHub Desktop.
BBEdit script to open the current file in Marked 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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