Draygoes Posted February 3, 2010 Share Posted February 3, 2010 I am writting a small script that will read the firefox address bar and save it to a text file to be read by a program that I am making. But right now, I want it to show me what it sees in the form of a message box. The problem with code below is that the message box displays "0". I take it that the read operation failed. Here is the code. I cannot think of any other way to do this, so any help would be appriciated. AutoItSetOption ("WinTitleMatchMode", 2 ) $address = WinGetText("Mozilla Firefox", "http://") MsgBox( 0, "asdf", $address ) Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
Torx Posted February 3, 2010 Share Posted February 3, 2010 Isn't Firefox using XUL and not the native Windows controls? This would explain why you cannot retrieve data from the controls, even though they look familiar. Ping Utility Link to comment Share on other sites More sharing options...
lainline Posted February 3, 2010 Share Posted February 3, 2010 #include <ClipBoard.au3> AutoItSetOption ("WinTitleMatchMode", 2 ) WinActivate ("Mozilla Firefox") Send("^l") Send("^c") $address=_ClipBoard_GetData($CF_TEXT) MsgBox( 0, "asdf", $address ) Link to comment Share on other sites More sharing options...
Draygoes Posted February 3, 2010 Author Share Posted February 3, 2010 Thanks! It works perfectly. Though the project that I am working on is private, and will most likely never be public, if I use this code in other projects I will give you proper credit. If I forget to, please remind me lol Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
dmob Posted February 3, 2010 Share Posted February 3, 2010 For more complete control of Firefox, I recommend this FF UDF. It's great. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now