Jump to content

RJP Computing

Members
  • Posts

    13
  • Joined

  • Last visited

Everything posted by RJP Computing

  1. Thanks for all the ideas. I ended up going with the semephore solution. Clean, simple, and effective. Cool ideas though. It is really amazing how everybody has a different idea. Thanks.
  2. How can I make it so that a compiled script can only be ran once? I need this because the script runs all the time and if I don't have that I don't get results as expected. I hope this question isn't to stupid. :"> I am sure that I am missing something simple. Thanks.
  3. Another question about VC7. It can produce .exe that don't require the .NET framework? If so, I had no idea cause I hate virtual machines. (Sorry if I step on anyones feet, it is just my opinion) Thanks
  4. What programming language is autoit written in? I just wanted to know. Maybe a better way to ask is what compiler is used? I know it is written in C++.
  5. CyberSlug, I fixed RJPad Lite! It now works with autosence. That is the coolest feature. I also added a shell execute so that I can launch the AutoIt scripts right from that. Thanks
  6. Thanks for the update. I will see what I can do. We definatly want it to comply with other standard editors. I will check it out. Thanks
  7. err=1 focus=1 getPos err=1 Here is the clipboard when it fails.
  8. I am using a home grown text editor and it works till I try to enter the word selected from the combox. The error is: Let me know if you need more info.
  9. The script isn't completed but all you need to do is open some program and use that for your .ini file settings. Change those and then change the class name in the while loop. I was using message boxes to check the text and it was coming back with 1(@error). Another quick question. Is this valid in AutoIt: $var1 = "some cool text" $var2 = "some cooler text" If $var1 == $var2 then MsgBox (0, "", "They are equal") PS. how long till the DLL version is finished?
  10. I presently do just that. I haven't had reliable luck getting the button text back if the window isn't the one with focus. Yes the AutoIt Spy has been a HUGE help! I oversimplified my problem but here is the whole script. I use ini files and such. ; ; AutoIt Version: 3.0 ; Language: English ; Platform: Win9x/NT ; Author: Ryan Pusztai (ryan.pusztai@jci.com) ; ; Script Function: ; Checks for a specific window then sends a click event to the specified button ; AutoItSetOption("TrayIconDebug", 1) ; Give the user a chance to quit $answer = MsgBox (4, "AutoWinClose", "Run script?") If $answer = 7 Then Exit ;User didn't want to run script EndIf ; Press Esc to terminate script, Pause/Break to pause Global $Paused Global $NumWindows Global $SearchMode Global $WinTitle[10] Global $ButtonText[10] HotKeySet("{PAUSE}", "TogglePause") HotKeySet("{ESC}", "Terminate") If FileExists(@ScriptDir & "\config.ini") Then ;MsgBox(4096, "",@ScriptDir & "\config.ini exists.") $NumWindows = IniRead(@ScriptDir & "\config.ini", "Setup", "NumWindows", "1") $SearchMode = IniRead(@ScriptDir & "\config.ini", "Setup", "SearchMode", "2") AutoItSetOption("WinTitleMatchMode", Number($SearchMode)) ; 2 = Match any substring in the title For $i = 0 To $NumWindows $WinTitle[$i] = IniRead(@ScriptDir & "\config.ini", "Windows", "WindowTitle" & String($i+1), "<Change>") $ButtonText[$i] = IniRead(@ScriptDir & "\config.ini", "Windows", "Button" & String($i+1), "<Change>") Next Else IniWrite(@ScriptDir & "\config.ini", "Setup", "NumWindows", "1") IniWrite(@ScriptDir & "\config.ini", "Setup", "SearchMode", "2") $file = FileOpen(@ScriptDir & "\config.ini", 1) ; Check if file opened for writing OK If $file = -1 Then MsgBox(0, "Error", "Unable to open file.") Exit EndIf FileWriteLine($file, "; SearchMode alters the method that is used to match window titles." & @LF) FileWriteLine($file, "; 1 = Match the title from the start (default)" & @LF) FileWriteLine($file, "; 2 = Match any substring in the title" & @LF) FileWriteLine($file, "; 3 = Exact title match" & @LF) FileWriteLine($file, "; 4 = Advanced mode" & @LF) FileClose($file) IniWrite(@ScriptDir & "\config.ini", "Windows", "WindowTitle1", "<Change>") IniWrite(@ScriptDir & "\config.ini", "Windows", "Button1", "<Change>") MsgBox(4096,"", "Please edit " & @ScriptDir & "\config.ini with your proper settings.") Run("notepad.exe " & @ScriptDir & "\config.ini") Exit EndIf ;SplashTextOn("myMsgScreen", "Running") ;WinShow("pauseSpecialScrn", "", @SW_HIDE) While 1;infinite loop If $Paused then Sleep(1000) Else PressButton ($WinTitle[0], "Button1", $ButtonText[0]) PressButton ($WinTitle[1], "AfxOleControl422", $ButtonText[1]) Sleep(1) ; stuff to do goes here ... EndIf Wend Func TogglePause() $Paused = NOT $Paused ;If $Paused then ;SplashTextOn("myMsgScreen", "Paused ...") ;Else ;SplashTextOn("myMsgScreen", "Running ...") ;EndIf EndFunc Func Terminate() If MsgBox(52, "AutoWinClose", "Close AutoWinClose?") = 6 Then Exit EndFunc Func PressButton($Title, $Class, $ButText) If WinExists($Title) Then WinActivate($Title, "") ;ControlFocus($Title, "", $Class) $var = ControlGetText($Title, "", $Class) ;MsgBox(0, $Class & " Text", $ButText) ;MsgBox(0, $Class & " Text", $var) If StringInStr($var, $ButText) Then ControlClick($Title, "", $Class) Else ;MsgBox(0, $Title, "Window DOESN'T exists") EndIf EndFuncThanks
  11. Hi all, I just started to use AutoIt and it is SWEET I am tring to run a script in the background to monitor for a message box to popup. I then get the button text and verify that the button has the same text as I expected. If that is the case I click the button. Now I got all that to work by using a while loop and just poll for the window. This works but to reliably get the buttons text I have to make sure the window has focus. This creates a window that is basicly always on top. You can't do anything else with the machine because I keep haveing to give the window focus. How can I get this to work a better way so that it is completely transparent and the machine can still be used? Clear as mud huh?
×
×
  • Create New...