Bert Posted January 12, 2010 Posted January 12, 2010 I've made a simple script to assist the loading of Outlook and 2 instances of Firefox when I log into my PC at work. Works fine. I've noticed however a small problem automating a window and I want to make sure I'm not being stupid. It has to do with the addon update window you get when there is an update for on of your installed addons. On the bottom of the window, there is a button called "Install Updates". I'm just trying to send a keystroke to it. I can do it if I do ALT+I manually using the keyboard no problem. Here is the wrinkle - no matter what I do, I can't use the send or controlsend to automate the "Install Update" button. What is real odd is though is I can use send or controlsend to work with the menubar on the top of the window. For example, ALT+F will open the file menu no problem.In testing, I tried working with the "Show Information" button which is ALT+S. That doesn't work either if I try to automate it. Works fine if I use the keyboard directly. Very odd.Here is the script I've been playing around with to see if I can do it. You can see where Ive been commenting out things in an attempt to get it working. $FU2 = WinExists ("[CLASS:MozillaDialogClass]") $FUS = WinGetPos ( "[CLASS:MozillaDialogClass]") if $FU2 = 1 and $FUS <> 0 Then if $FUS[3] > 200 then WinActivate("[CLASS:MozillaDialogClass]") sleep(500) Send("{ALT}s") sleep(20) ;~ Send("S") ;~ ControlSend("[CLASS:MozillaDialogClass]", "","", "S") ;~ ControlSend("[CLASS:MozillaDialogClass]", "","", "f") ;~ Send("{ALTUP}") EndIf endifThe script will make the window in question gain focus everytime, so I know I have the "[CLASS:MozillaDialogClass]" right. Can someone test this with Firefox to see if it is my rig or am I just missing something. Thanks.Note: I do not wish to do a mouseclick to do this. If the window changes size for any reason, it breaks. Also, I have to be careful of just what I install on my rig, so using FF.au3 is not an option for me on my work rig. The Vollatran project My blog: http://www.vollysinterestingshit.com/
somdcomputerguy Posted January 12, 2010 Posted January 12, 2010 I was able to have that code work, but only when I replaced [CLASS:MozillaDialogClass] with Mozilla. BTW, ALT+s brings up the History in my Firefox. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
Bert Posted January 12, 2010 Author Posted January 12, 2010 I know ATL+s brings up history. I was using that to test with for once you kick off the update, you lose the window. However, you did answer my question. Thanks! The Vollatran project My blog: http://www.vollysinterestingshit.com/
somdcomputerguy Posted January 12, 2010 Posted January 12, 2010 Oh yeah, re: the alt+s, forgot about the 'Install Updates' window thing.. Anyway, glad you got it woking. - Bruce /*somdcomputerguy */ If you change the way you look at things, the things you look at change.
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