Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

George Benainous http://java.georgebenainous.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

Compile the front TextWrangler java source file using applescript

// If you use TextWrangler to edit java source code,
// 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
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS