I am using git to manage a project that has a few binary files that need to be closed before being committed. So I need a git hook, that checks to see if the application that has these files open is running.
Here is the script I am using
tell application "System Events"
set apps to the name of every process whose background only is false
if "Some App" is in apps then
error "Some App is running. Can't commit until Some App is quit" number 5
But I am getting this error when I commit or execute the pre-commit. Even when "Some App" is not running.
.git/hooks/pre-commit:50:106: execution error: An error of type -10810 has occurred. (-10810)
Permissions on the file are
-rwxr-xr-x@ 1 toddgeist staff 263 Dec 7 07:33 pre-commit