At first, Joel's excellent tutorial didn't work for me (on OS X 10.11.6 and Excel for Mac 2011). After some sleuthing, I discovered that my problem was caused by "extended attributes" in my script file, test.sh. In Terminal, ls -l test.sh
yields:
-rwxr-xr-x@ 1 tgk staff 456 Mar 16 13:12 test.sh
Note that "@" indicates the presence of extended file attributes. More information is given by invoking ls -l@ test.sh
, which yields:
-rwxr-xr-x@ 1 tgk staff 456 Mar 16 13:12 test.sh
com.apple.FinderInfo 32
com.apple.TextEncoding 15
In other words, depending on how the file was created, it may or may not have extended attributes. So I stripped off the extended attributes via xattr -c test.sh
, and then Joel's call: Shell ActiveWorkbook.Path & ":test.sh"
worked perfectly! Many thanks to all.
____
I later learned that saving the shell script without writing extended attributes is possible in TextWrangler by first invoking defaults write com.barebones.textwrangler WriteExtendedAttributes never
in Terminal. However, this only prevents the addition of the com.apple.FinderInfo
attribute; the com.apple.TextEncoding
attribute remains. Fortunately, however, Joel's VBA Script command now works when the shell script has just the com.apple.TextEncoding
extended attribute! So, TextWrangler is the editor for me!