Lee Bussy Posted May 20, 2010 Posted May 20, 2010 Here's the deal. Let's say a company decides they would rather put an annoying pop-up on an application telling you they will sever your connection "soon" rather than buy more licenses so you can ... oh I dunno ... simply monitor a help desk queue during the day. Let's say fo the sake of argument I work there. I thought this would be simple but I only get back to AutoIT once in a while and apparently I forget simple things. This is what I thought would work:WinWait("[TITLE:Windows Internet Explorer; CLASS:Static", "") WinActivate("[TITLE:Windows Internet Explorer; CLASS:Static", "") Send("{ENTER}")I've attached a pic of what it looks like. Here's the window info from AutoIT Window Info:expandcollapse popup>>>> Window <<<< Title: Windows Internet Explorer Class: #32770 Position: 660, 426 Size: 354, 185 Style: 0x94C801C5 ExStyle: 0x00010101 Handle: 0x00A3070C >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 891, 450 Cursor ID: 2 Color: 0x0069FF >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK Cancel (12203) It is '12:37 on Thu, 20-May-2010'. If you are still using the Service Desk Express application, please click OK within the next 9 minutes to continue. Otherwise, your session will expire and you will need to log on again. >>>> Hidden Text <<<<Would someone care to point me in the right direction please? I suspect it's because this is java of some sort rather than a process but I'm just not sure.
PsaltyDS Posted May 20, 2010 Posted May 20, 2010 Why are you using "CLASS:Static", when the dialog window is plainly "CLASS:#32770" in your AU3Info data. "Static" is a text control class (like AutoIt's "Label"). Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
JohnOne Posted May 20, 2010 Posted May 20, 2010 On 5/20/2010 at 7:55 PM, 'PsaltyDS said: Why are you using "CLASS:Static", At the risk of making a tw@ of myself Im going to propose that the OP could be disguising his true intentions (but not very well) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Lee Bussy Posted May 20, 2010 Author Posted May 20, 2010 On 5/20/2010 at 7:55 PM, 'PsaltyDS said: Why are you using "CLASS:Static", when the dialog window is plainly "CLASS:#32770" in your AU3Info data. "Static" is a text control class (like AutoIt's "Label").Uh ....*crickets*I swear I saw that class name there. That could definitely have something to do with it huh? Let me give that a go again and see what happens. Thanks. On 5/20/2010 at 8:23 PM, 'JohnOne said: At the risk of making a tw@ of myself Im going to propose that the OP could be disguising his true intentions (but not very well)If you want to say something, say it. Not really sure what the hell you are talking about but if you think I am doing something nefarious then by all means spit it out. I'd suggest you look at the date I joined rather than whether or not you recognize my name when trying to figure out if I'm a kid doing something wrong or an IT professional with an issue (however stupid a mistake it might be).
JohnOne Posted May 20, 2010 Posted May 20, 2010 On 5/20/2010 at 8:34 PM, 'Lee Bussy said: Uh ....*crickets*I swear I saw that class name there. That could definitely have something to do with it huh? Let me give that a go again and see what happens. Thanks. If you want to say something, say it. Not really sure what the hell you are talking about but if you think I am doing something nefarious then by all means spit it out. I'd suggest you look at the date I joined rather than whether or not you recognize my name when trying to figure out if I'm a kid doing something wrong or an IT professional with an issue (however stupid a mistake it might be).Gladly.I think you are a cunt, and up to no good. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Lee Bussy Posted May 20, 2010 Author Posted May 20, 2010 On 5/20/2010 at 9:00 PM, 'JohnOne said: I think you are a cunt, and up to no good.As opposed to you I suppose? If I'm violating the rules somehow then report me, otherwise don't miss a good excuse to keep your thoughts to yourself.
Moderators SmOke_N Posted May 20, 2010 Moderators Posted May 20, 2010 On 5/20/2010 at 9:00 PM, 'JohnOne said: Gladly.I think you are a cunt, and up to no good.Not sure where this was deserved. Please refrain. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
JohnOne Posted May 20, 2010 Posted May 20, 2010 Yes ok.You did ask me though Quote If you want to say something, say itThe End. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Lee Bussy Posted May 20, 2010 Author Posted May 20, 2010 Just in case my attempt at a slight amount of humor when I opened this thread was lost on anyone else; this is a help desk application that my company has licensed (if someone was clever enough they could figure out the application from what I posted). They recently added hundreds of users, and rather than add licenses they chose to do this to "stretch" their licenses. Completely legitimate on their part as they are adhering to their per-user license agreement. I manage a support team and I keep a window open on my second monitor with the queue among other things. I need to be able to glance over there and see if there's anything going on at any time. We're getting too big for our own good and a legitimate need is quickly swept under the rug by bureaucracy so I decided I'd just keep clicking. That being what AutoIT was designed to do, I don't much see any harm. It's not against any EULA, it's not a MMORPG, I'm not a script kiddie. I've been in IT almost 25 years now and I can make silly mistakes just like anyone else can. Being in management means I don't get a chance to hone my skills often enough to stay proficient. That's why I occasionally ask here, and thankfully some folks here are (still) kind enough to take the time to answer - even if that answer is to point out a bone-head mistake on my part.
JohnOne Posted May 20, 2010 Posted May 20, 2010 Are you just wanting to close that window when it appears? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Lee Bussy Posted May 20, 2010 Author Posted May 20, 2010 On 5/20/2010 at 10:30 PM, 'JohnOne said: Are you just wanting to close that window when it appears?I'm wanting to hit the "OK" button (which is highlighted by default). The pop-up does not become active meaning I miss it more often than not.I have not had the chance to fix my screwup with the class name, I'll give it a go when I hit the office in the morning.
JohnOne Posted May 20, 2010 Posted May 20, 2010 Maybe something like this, perhaps in a function called by adlibregister if you are unsure when it will pop up Opt("WinTitleMatchMode", 3) If WinExists("Windows Internet Explorer") Then $hwnd = WinActivate("Windows Internet Explorer") ControlClick($hwnd,"",$ID,"Primary",1) ; where $ID id the button class EndIf AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Lee Bussy Posted May 20, 2010 Author Posted May 20, 2010 On 5/20/2010 at 10:53 PM, 'JohnOne said: Maybe something like this, perhaps in a function called by adlibregister if you are unsure when it will pop upWas not familiar with AdlibRegister, that's a good one to use. I was going to put it in a loop, the function is even more snazzy.
JohnOne Posted May 20, 2010 Posted May 20, 2010 It is, ive never needed it really but my latest "have a go" effort will employ it. But if you dont want it called throught the whole of your script, I suppose you could emulate it with TimerInit and TimerDiff, or otionally register and unregister it where its needed. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
Moderators SmOke_N Posted May 21, 2010 Moderators Posted May 21, 2010 (edited) Sounds like you just want to run this as a stand alone.This should do what you want.Global $s_window_title = "Windows Internet Explorer" While 1 WinWait($s_window_title, "If you are still using the Service Desk Express application") ControlClick($s_window_title, "OK", "[CLASS:Button]") Sleep(250) WEndEdit:This should do what you want safely. Without the concern of it popping off on some other windows that might have the same title. Edited May 21, 2010 by SmOke_N Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.
Lee Bussy Posted May 21, 2010 Author Posted May 21, 2010 (edited) Thanks John and Smoke_N. I'll give those a try when I get to the office this morning (after coffee of course). Every time I come back to AutoIT I am amazed at it's versatility. I've done some pretty complicated stuff with it in the past (back when we could talk about game automation here) and it was limited only by the imagination. EDIT: Works great, thanks again! Edited May 21, 2010 by Lee Bussy
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