Compile the front TextWrangler java source file using applescript
// this AppleScript will compile the front window.
1 2 tell application "TextWrangler" 3 set the_file to file of text document 1 4 end tell 5 6 set AppleScript's text item delimiters to ":" 7 set source_file to the last text item of (the_file as string) 8 9 tell application "Finder" 10 set the_folder to container of the_file as alias 11 end tell 12 13 tell application "Terminal" 14 activate 15 set shell_script to "cd " & (quoted form of POSIX path of the_folder) & "; javac " & source_file 16 if (count windows) is 0 then 17 do script shell_script 18 else 19 do script shell_script in the front window 20 end if 21 end tell