Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
URL identification
#3
For Firefox.

Function FirefoxGetAddress
Code:
Copy      Help
;/
function~

;Returns URL from address bar of Firefox browser.
;Error if fails.
;Tested with Firefox 3.6.8 - 21.0. May fail with other versions.
;Fails if address bar is hidden.

;EXAMPLE
;str s=FirefoxGetAddress
;sel s 3
,;case "http://www.google.*"
,;out "Google"
,;
,;case "http://www.quickmacros.com*"
,;out "Quick Macros"
,;
,;case else
,;out s


int w=win("Mozilla Firefox" "Mozilla*WindowClass" "" 0x804)
Acc a=acc("Search or enter address|Go to a Website|Go to a Web Site|Search Bookmarks and History|Location" "TEXT" w "" "" 0x1802 0x0 0x20000040)
ret a.Value

err+ end _error

______________________________________

For Internet Explorer

Function IeGetAddress
Code:
Copy      Help
;/
function~

;Returns URL from address bar of Internet Explorer browser.
;Error if fails.
;Tested with IE 5, 6, 7, 8. May fail with other versions.
;Fails if address bar is hidden.

;EXAMPLE
;str s=IeGetAddress
;sel s 3
,;case "http://www.google.*"
,;out "Google"
,;
,;case "http://www.quickmacros.com*"
,;out "Quick Macros"
,;
,;case else
,;out s


Acc a=acc("Address" "TEXT" win(" Internet Explorer" "IEFrame") "Edit" "" 0x1801 0x0 0x20000040)
ret a.Value

err+ end _error

______________________________________

For Chrome

Function ChromeGetAddress
Code:
Copy      Help
;/
function~

;Returns URL from address bar of Google Chrome browser.
;Error if fails.
;Tested with Chrome 5.0. May fail with other versions.
;Fails if address bar is hidden.

;EXAMPLE
;str s=ChromeGetAddress
;sel s 3
,;case "http://www.google.*"
,;out "Google"
,;
,;case "http://www.quickmacros.com*"
,;out "Quick Macros"
,;
,;case else
,;out s


Acc a=acc("Location" "TEXT" win(" Chrome" "Chrome_WidgetWin_0") "" "" 0x1801 0x0 0x20000040)
ret a.Value

err+ end _error


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)