restating path program

I’d like to restate my earlier post more clearly. I’m having difficulty find the path to files that are not on the desktop in the code below.

tell application "Smultron"
	set theFile to the name of the front window
	set theClass to the first word of theFile
	set theFile to theClass & ".java"
	this is where I need help
	I'd like to find the path of theFIle
	wherever it is, not just on the desktop
	set thePath to "~/Desktop"
	set s to the bounds of the front window
end tell

tell application "Terminal"
	do script with command "cd " & thePath & ";clear; javac " & theFile & "; java " & theClass & "; echo"
	set bounds of front window to {(item 3 of s) + 2, (item 2 of s) - 13, (item 3 of s) + 350, (item 2 of s) + 350}
	close the second window
end tell

Model: Powerbook G4
AppleScript: 1.10
Browser: Safari 412
Operating System: Mac OS X (10.4)

How did the file window get open on the desktop in the first place? Wouldn’t it be easier to find out from that than to try to find the file itself?

I’m using Smultron as a programmer’s text editor and I’m trying to use Applescript to add a “run in teminaI” command which Smultron doesn’t have. I could choose the file from a dialog box and get the file path from that but I’d like to just click an applescript app which runs the open Smultron window in the terminal. I know I’m asking for something basic but I’m having a hard time finding that one step finding the path to an open application window or document. Thanks, George