Skip to content

Instantly share code, notes, and snippets.

@lyndell
Last active July 10, 2016 02:49
Show Gist options
  • Save lyndell/c42c4d5f23346cf70730 to your computer and use it in GitHub Desktop.
Save lyndell/c42c4d5f23346cf70730 to your computer and use it in GitHub Desktop.
Open a new file in ByWord
#/bin/bash -x
#
# Copyright (c) 2015 Lyndell Rottmann
#
# Debug mode on/off: (default off)
set +x
if [[ "$OSTYPE" == "darwin"* ]]; then
if [ ! $1 ]
then
echo "No file specified."
exit;
else
file=$1
# if file doesn't exist, create it.
if [ ! -e $file ]
then
touch $file
fi
open -a byword $file
fi
else
# Not a Mac
echo "Byword is a Mac only application.\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment