Getting path name on save

I have an applescript document application. I need to get the POSIX path of the document when the user saves the document. When I use:

on write to file theObject path name pathName of type ofType
set theDocumentPath to pathName

. . . theDocumentPath reads: “/private/tmp/501/TemporaryItems/”
when I saved it to the Desktop.

How can I get the REAL path to the saved location?
Is there a Call Method that will work? . . . can I override the NSDocument save panel with the “open save panel” command?
and/or, is there a way to do this On Data Representation?
Ultimately, I need the document’s location to be able to send a shell command to MySQL to save its current database in the same folder with the AS document.