I am looking for a GUI scripting workaround since I know this seems impossible in Firefox at the moment. I know this can be achieved using the following method:
tell application "System Events"
Keystroke "l" using command down
Keystroke "c" using command down
end tell
tell me to activate
set theUrl to the clipboard as text
end tell
But I would like to do this without interrupting the user. A GUI scripting method for Google Chrome was proposed here:
http://stackoverflow.com/questions/2483033/get-the-url-of-the-frontmost-tab-from-chrome-on-os-x
and I was looking for something similar.
tell application "Google Chrome"
activate
tell application "System Events"
tell application process "Google Chrome"
get value of text field 1 of tool bar 1 of window 1
end tell
end tell