I am working with AppleScript and need to do this:
set TextToWrite to \" #!/bin/bash cd \"$( dirname \"$0\" )\" java -server -Xmx4G -jar ./craftbukkit.jar\"
quoted form of (dirname as POSIX path)