You can get the current URL of the current window from Safari with the following appscript:

import appscript
print appscript.app("Safari").windows.first.current_tab.URL()

MacPython/Safari (last edited 2009-05-21 13:14:12 by 185-238-173-209)

Unable to edit the page? See the FrontPage for instructions.