Skip to content

Instantly share code, notes, and snippets.

@prenagha
Created September 8, 2015 00:18
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prenagha/404284fee1b8ff86aec5 to your computer and use it in GitHub Desktop.
Save prenagha/404284fee1b8ff86aec5 to your computer and use it in GitHub Desktop.
Compile .applescript files to .scpt files. Useful for LaunchBar actions and such.
#!/bin/bash
#
# find all launchbar action .applescript scripts and compile them
#
LBDEV=~/Dev/launchbar
find $LBDEV -type f -name '*.applescript' -print0 | while read -d '' -r APPLESCRIPT
do
echo "Compiling $APPLESCRIPT ..."
SCPT="${APPLESCRIPT%.applescript}.scpt"
/usr/bin/osacompile -o "$SCPT" "$APPLESCRIPT"
if [ $? -ne 0 ]
then
"Error compiling $APPLESCRIPT" 1>&2
exit $?
fi
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment