views:

53

answers:

2

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
A: 

You can probably do the "google chrome" technique in firefox. You just need to know how to reference the proper field. For that you can google for UIElementInspector. That's a free program from Apple that will help you identify those references. You run the program and hold your mouse over the field... and it shows the reference.

regulus6633
Unfortunetely UIElementInspector doesn't seem to work for firefox windows, it treats the entire window as a single entity. Do you know of another tool that can extract the UI elements? Thanks.
David K
A: 

http://pfiddlesoft.com/uibrowser/

Zygmunt
UIbrowser doesn't work with firefox either :(
David K