mikezwet2 Posted October 8, 2006 Share Posted October 8, 2006 Hello, I have a script that must run when i press (for example) control button. So the script must be open always and wait for input, must be a loop? I hope someone can give an example of how this works. Kind Regards, Mike Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
jvanegmond Posted October 8, 2006 Share Posted October 8, 2006 (edited) For the control-key, there is just one way of doing this. #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("11", $dll) Then MsgBox(0,"_IsPressed", "Ctrl Key Pressed") ExitLoop EndIf WEnd DllClose($dll) This is a slight modification from the helpfile. Get the latest AutoIt version and look up _IsPressed. Edited October 8, 2006 by Manadar github.com/jvanegmond Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 8, 2006 Author Share Posted October 8, 2006 (edited) For the control-key, there is just one way of doing this. #include <Misc.au3> $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _IsPressed("11", $dll) Then MsgBox(0,"_IsPressed", "Ctrl Key Pressed") ExitLoop EndIf WEnd DllClose($dll)oÝ÷ Ù8b²+²X Ù¨v'âq«b¢wë¢kaz¥¥ø¥xg¶¥j׬´ oz»"¢v§vZ(êH°úÞ²Çþ«¨µã¤z&uçm+"l¬r¸©µ»Ü(Ü(®HßÛ,k+,¢g)àiº.¶éä'~éܶ*'©jëh×6 $dll = DllOpen("user32.dll") While 1 Sleep ( 250 ) If _CopySelected("11", $dll) Then ClipGet() WinActivate("FileMaker Developer", "") WinWaitActive("FileMaker Developer") Send ("^9") ExitLoop EndIf WEnd DllClose($dll) The meaning is: 1] To copy a user selected text, like a name in a word document. 2] Press a key like control. 3] Phe autoit script wakes up and paste the text in my database programm (file maker pro) 4] Return from where autoit copy the previous text to go on. (file is always different, so must be a go back function, wich i have not found jet....) The script must not be closed Edited October 8, 2006 by mikezwet2 Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
zcoacoaz Posted October 8, 2006 Share Posted October 8, 2006 You forgot the #include <Misc.au3> line [font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font] Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 8, 2006 Author Share Posted October 8, 2006 Great it works. Now i want to minimize a programm but don't know where i have to place the numer "16" for minimize WinGetState("FileMaker Developer", "") ??? Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
jvanegmond Posted October 8, 2006 Share Posted October 8, 2006 WinSetState("Title", "Text", @SW_MINIMIZE) github.com/jvanegmond Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 24, 2006 Author Share Posted October 24, 2006 In this script i want to add a wait until a internet explorer screen is loaded. Problem is that the is already a IE screen open and the second screen name is always diferent except the word Always different text........ Detail page - Internet explorer How do i add this in a WinWaitActive("Detail Page - Internet Explorer") <<< Is not working :"> Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 25, 2006 Author Share Posted October 25, 2006 In this script i want to add a wait until a internet explorer screen is loaded.Problem is that the is already a IE screen open and the second screen name is always diferent except the wordAlways different text........ Detail page - Internet explorerHow do i add this in a WinWaitActive("Detail Page - Internet Explorer") <<< Is not working :">I hope someone can help me, i still did nog figure it out... Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot Link to comment Share on other sites More sharing options...
Rad Posted October 25, 2006 Share Posted October 25, 2006 (edited) See _IELoadWait in the helpfile Wait for a browser page load to complete before returning. --- #include <IE.au3> _IELoadWait ( ByRef $o_object [, $i_delay = 0 [, $i_timeout = -1]] ) Im not up to date on the IE commands though, so thats about as far as I can go. You may have to create the IE window to $YourIE = _IECreate() edit - You could also try using the winhandles, they dont change like the name of a window. See the helpfile Edited October 25, 2006 by Rad Link to comment Share on other sites More sharing options...
mikezwet2 Posted October 26, 2006 Author Share Posted October 26, 2006 (edited) See _IELoadWait in the helpfile Im not up to date on the IE commands though, so thats about as far as I can go. You may have to create the IE window to $YourIE = _IECreate() edit - You could also try using the winhandles, they dont change like the name of a window. See the helpfile I have figured it out a differtent way like this: AutoItSetOption ("WinTitleMatchMode", 2) WinClose("Microsoft Internet Explorer", "") It does not close a specific IE window but the window on top. In my case its the IE on top wich has to close. Edited October 26, 2006 by mikezwet2 Zwetsloot Kunststof Kozijnen Fabriek and Mike Zwetsloot 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