I am working with AppleScript and need to do this:
set TextToWrite to \" #!/bin/bash cd \"$( dirname \"$0\" )\" java -server -Xmx4G -jar ./craftbukkit.jar\"
set x to "He said \" Enter the matrix.\" "display dialog x
Just copy this into applescript the easiest way to understand.