I wish I had done this before:

tell application "System Events"
set {name:theApp, bundle identifier:theIdentifier} to (get 1st application process whose frontmost is true)
        set x to theApp
end tell



tell application "Firefox" to set currentURL to «class curl» of window 1
--firefox may fail sometimes to get the URL with either of these methods. Try your luck!!
(*set myFirefox to properties of front window as list
set currentURL to item 3 of contents of myFirefox*)

set the clipboard to currentURL

tell application x
        activate
        tell application "System Events"
                        tell process x
                        delay 1
                        keystroke "v" using command down
                end tell
        end tell
end tell


Reply via email to